Visual Basic Extensibility Reference

AfterRemoveFile Event

See Also   Example   Applies To

Occurs after a file is removed from the active Visual Basic project.

Syntax

Subobject**_AfterRemoveFile(vbprojectAs VBProject**, filetypeAs vbext_FileType, filenameAsString)

The AfterRemoveFile event syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
vbproject A VBProject object specifying the name of the project from which the file was removed.
filetype An enumerated value (vbext_FileType) specifying the type of file that was removed, as listed in Settings.
filename A string expression specifying the name of the file that was removed.

Remarks

The AfterRemoveFile event does not occur for components that are removed before they have been saved.

This event occurs in all add-ins that are connected to the FileControl object. The add-in cannot prevent the file from being written to disk because the operation is complete. However, you can use this event to perform other tasks, such as:

  • Log information about the event.

  • Update information about the file.

  • Back up the file.