Export (0) Print
Expand All

How to: Map Schemas to Word Documents Inside Visual Studio

Important   The information set out in this topic regarding Microsoft Word is presented exclusively for the benefit and use of individuals and organizations who are located outside the United States and its territories or who are using, or developing programs that run on, Microsoft Word products that were licensed by Microsoft before January 2010, when Microsoft removed an implementation of particular functionality related to custom XML from Microsoft Word. This information regarding Microsoft Word may not be read or used by individuals or organizations in the United States or its territories who are using, or developing programs that run on, Microsoft Word products that were licensed by Microsoft after January 10, 2010; those products will not behave the same as products licensed before that date or purchased and licensed for use outside the United States.

Applies to

The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.

Project type

  • Document-level projects

Microsoft Office version

  • Word 2007

  • Word 2003

For more information, see Features Available by Application and Project Type.

You can map an XML schema to a document while the document is open in Visual Studio. You use the same Microsoft Office Word tools that you use when the document is open outside of Visual Studio. The Visual Studio Tools for Office project creates the same objects whether you map the schema to the document before or after you create your Word solution.

The procedures are different for Word 2007 and Word 2003.

To map an XML schema to a Word 2007 document in Visual Studio

  1. Open the Word document or template project inside Visual Studio.

  2. Click in the document to move the focus to the designer.

  3. On the Ribbon, click the Developer tab.

    NoteNote:

    If the Developer tab is not visible, you must first show it. For more information, see How to: Show the Developer Tab on the Ribbon.

  4. In the XML group, click Schema.

    The Templates and Add-ins dialog box opens.

  5. Click the XML Schema tab.

  6. Click Add Schema.

    The Add Schema dialog box opens.

  7. Browse to your schema file, select it, and then click Open.

    The Schema Settings dialog box opens.

  8. Assign an alias or click OK to add the schema without an alias.

  9. Click OK.

    The XML Structure window opens.

  10. Drag elements from the XML Structure window to the places in your document where you want the corresponding controls to be created.

To map an XML schema to a Word 2003 document in Visual Studio

  1. Open the Word document or template project inside Visual Studio.

  2. Click in the document to move the focus to the designer.

  3. On the Tools menu, point to Microsoft Office Word Tools, and then click Templates and Add-Ins.

    The Templates and Add-ins dialog box opens.

  4. Click the XML Schema tab.

  5. Click Add Schema.

    The Add Schema dialog box opens.

  6. Browse to your schema file, select it, and then click Open.

    The Schema Settings dialog box opens.

  7. Assign an alias or click OK to add the schema without an alias.

  8. Click OK.

    The XML Structure window opens.

  9. Drag elements from the XML Structure window to the places in your document where you want the corresponding controls to be created.

Community Additions

ADD
Show:
© 2014 Microsoft