Add File Command (Project Menu)

   

Adds an existing file to the current project. You can share files between projects. If you add a file to a project, you are simply including a reference to the existing file in the project; you are not adding a copy of the file to the project. Therefore, if you make changes to the file and save it, your changes will affect any project that includes the file.

Available at design time only.

Keyboard shortcut:  CTRL+D.

Note   Use the Components command on the Project menu to add ActiveX controls and insertable objects to your project's Toolbox.

If you have connected to a source code control program, such as Microsoft SourceSafe (available with the Enterprise Edition), when you add a file to a Visual Basic project, a dialog may prompt you to add the file in the version control project.

With Microsoft SourceSafe, if the .vbp file is checked out, the references to the newly added file(s) are automatically added. If the .vbp file isn't checked out, when you add a file, the .vbp file will not contain a reference to the new file, and thus, it will not load the next time you open your project.

Dialog Box Options

Look in

Select the location from which you want to add the file.

   Up One Level

Shows a list of folders or drives one level above the current folder.

   Create New Folder

Creates a new folder.

   List

Shows the folders or documents in a list format that includes the folder or document icon and its name.

   Details

Shows the folder or documents in a list that includes the folder or document icon and name, its size (documents only), type, and the date and time it was last modified.

File name

Select or type the name of a file you want to open. This box lists documents with the filename extension selected in the List Files of Type box.

List files of type

Select a file type from the list:

Open

Adds the file to the project.

Cancel

Closes the dialog box without adding the file to the project.

Add As Related Document

Adds items such as Microsoft Excel worksheets or Microsoft Word document to the Related Documents folder in the Project Explorer.