Share via


Creating a New Active Document

You can create new documents in the Visual C++ environment other than simple text files or file types that the build system recognizes. Because Visual C++ is an Active document container, you can create and work in document types such as those created by Microsoft Word or Microsoft Excel.

To create a new Active document within Visual C++

  1. Click New on the File menu and choose the Other Documents tab.

  2. Select a document file type from the list.

  3. To add the document file to an existing project, select the Add to Project check box and choose a project name from the list.

  4. Type a filename in the File Name box. If you do not supply an extension, the default extension for the file type is automatically appended to the filename.

    Note   You should use the extension associated with the appropriate COM component, such as .xls for a Microsoft Excel spreadsheet. Whenever you open an Active document in the development environment, the extension is used to identify the associated Active component.

  5. Click OK.

To open an existing document in a Visual C++ project

  • Double-click the filename in the FileView pane of the Project Workspace.

    If the document is an Active document, it is opened within the development environment and the toolbars for the associated COM component become available.