If you open this document in the designer, the project might be corrupted

If you open this document in the designer, the project might be corrupted. The document is saved in a format that allows macros, but it is not in a trusted location. To use this document without corrupting the project, add the document location to the list of trusted locations in the Trust Center in Word, and then reopen the document in the designer.

Word Document and Word Template projects that are based on a document that allows macros (such as documents that have a .doc or .docm file name extension) require the document to be trusted. Enable macros to run in the document that is located in the project folder before you begin to develop the project. If you do not enable macros to run, you might encounter the following errors after you open the document in the designer:

  • If the document contains Windows Forms controls, you might be prevented from adding new controls to the document, and you might receive compile errors when you build the project.

  • If the document contains a VBA project, the VBA project might be corrupted or deleted from the document.

The recommended way to avoid these issues is to add the folder that contains your Visual Studio Tools for Office project to the list of trusted locations in the Trust Center in Word.

To correct this error

  1. Start Word.

  2. Add the folder that contains your Visual Studio Tools for Office project to the list of trusted locations in the Trust Center in Word. Make sure that you also trust subfolders of the project folder.

    For more information, see Create, remove, or change a trusted location for your files in the Microsoft Office Online Help.

  3. Exit Word.

  4. In Visual Studio, open the document in the designer.

See Also

Tasks

How to: Create Visual Studio Tools for Office Projects

Concepts

Security in Office Solutions (2007 System)