Delen via


Word Designer

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.

When you create a Microsoft Office Word project, a document opens in Visual Studio. There is one design view for Microsoft Office Word documents, which is the document itself. You can design the look of the document while it is open in the designer by using the normal Word tools.

When you double-click the document surface, your cursor moves to that location as usual. Similarly, when you double-click a word, that word is selected. However, if the word is inside a host control, such as a Bookmark control, the Code Editor opens and the default event handler for the control is generated or opened if it already exists. For more information about host controls, see Host Items and Host Controls Overview.

Toolbars

For Word 2003 document-level projects, Word toolbars appear inside the designer and are fully functional. The default set and layout of toolbars depends on how you have it set for Word.

Toolbar customization works in the following ways inside the Visual Studio environment:

  • You can add and remove toolbars by using the View menu or by right-clicking the toolbar in the designer.

  • You cannot dock Word toolbars into the Visual Studio set of toolbars.

  • You cannot customize toolbar layout within a toolbar group.

  • You cannot move toolbar commands into the menus.

There are two views in the designer: Design view and Code view.

  • Design view
    Design view is the graphical view of the document and application. Word opens in the designer along with the document so that you can access the menus and toolbars or Ribbon tabs, and design the document without having to go outside of the Visual Studio environment. For Word 2003 document-level projects, the Word menus are merged with the Visual Studio menus, but the toolbars are in the designer just above the document. For more information, see Office Menus in the Visual Studio Environment.

    You can edit and modify a document by using the native functionality of Word; for example, you can use the undo or the Find feature just as you would when you edit a Word document. You can also use the Visual Studio tool windows and editors to customize the document or workbook.

  • Code view
    The Code Editor associated with the document in the designer is the same as the Code Editor you use to write code in a Windows Forms application. For more information, see Code and Text Editor.

See Also

Concepts

Office Documents in the Visual Studio Environment Overview

Other Resources

User Interface Reference (Visual Studio Tools for Office)