Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Add Existing Item Command

Adds an existing file to the current solution and opens it.

File.AddExistingSolutionItem filename [/e:editorname]

Arguments

filename
Required. The full path and file name, with extension, of the item to add to the current solution. If the file path or file name contains spaces, enclose the entire path in quotation marks.

Switches

/e:editorname
Optional. Name of the editor in which the file will be opened. If the argument is specified but no editor name is supplied, the Open With dialog box appears.

The /e:editorname argument syntax uses the editor names as they appear in the Open With Dialog Box, enclosed in quotation marks. For example, to open a style sheet in the source code editor, you would enter the following for the /e:editorname argument.

/e:"Source Code (text) Editor"

Remarks

Autocompletion tries to locate the correct path and file name as you type.

Example

This example adds the file, Form1.frm, to the current solution.

>File.AddExistingSolutionItem "C:\public\solution files\Form1.frm"

See Also

Visual Studio Commands with Arguments | Command Window | Find/Command Box | Pre-defined Visual Studio Command Aliases

Show:
© 2015 Microsoft