Visual Basic Extensibility Reference

Visual Studio 6.0

AfterChangeFileName Event

See Also   Example   Applies To

Occurs after a file in the current project has been saved for the first time, or saved with a new name. It also occurs when the project is first compiled to an .Exe file, or when compiled to a new .Exe name.


Sub object_AfterChangeFileName (vbproject As VBProject, filetype As vbext_FileType, newname As String, oldname As String)

The AfterChangeFileName 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 in which the file was changed.
filetype An enumerated value (vbext_FileType) specifying the type of file that was changed, as listed in Settings.
newname A string expression specifying the new name of the file.
oldname A string expression specifying the old name of the file.


The enumerated values for vbext_FileType are:

Constant Value Description
vbext_ft_Form 0 File type is a form.
vbext_ft_Module 1 File type is a basic module.
vbext_ft_Class 2 File type is a class module.
vbext_ft_Project 3 File type is a project.
vbext_ft_Exe 4 File type is an executable file.
vbext_ft_Res 6 File type is a resource file.
vbext_ft_UserControl 7 File type is a User control.
vbext_ft_PropertyPage 8 File type is a Property Page.
vbext_ft_DocObject 9 File type is a User Document.
vbext_ft_Binary 10 File type is a binary file.
vbext_ft_GroupProject 11 File type is a group project.
vbext_ft_Designer 12 File type is a designer object.