Visual Basic Extensibility Reference

Visual Studio 6.0

AfterRemoveFile Event

See Also   Example   Applies To

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


Sub object_AfterRemoveFile(vbproject As VBProject, filetype As vbext_FileType, filename As String)

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.


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.