Udostępnij za pośrednictwem


Office Menus in the Visual Studio Environment

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

  • Excel 2003

  • Word 2003

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

When you open a document inside Visual Studio, the Microsoft Office Word 2003 and Microsoft Office Excel 2003 application environment is integrated into the Visual Studio designer. You can work with the features of each application to design the look of your document at the same time that you write managed code to extend its capabilities. The menus that belong to Word or Excel merge with the Visual Studio menus, and are accessible from the Visual Studio menu bar.

Office Menu Items

You must select the document to give it focus before the Word or Excel menu items appear in the Visual Studio menus. If another part of Visual Studio has focus, for example Solution Explorer or the Properties window, the Office document menu items are not available.

Some menus, such as Tools and View, contain many items that are important to have available for both Visual Studio and Office at the same time. To make menu navigation easier, the Office menu items are all placed in a separate submenu, accessible from the top of the corresponding Visual Studio menu. Other menus, such as File, only present certain options that can be performed within the Visual Studio environment, and do not make all the Office menu items available. If a menu shortcut key is duplicated on the Visual Studio and Office menus, you can toggle between them by holding down the ALT key and pressing the shortcut letter repeatedly.

You cannot customize the Word and Excel menus while in the Visual Studio environment.

The merged menus look slightly different from the usual Visual Studio and Office menus. This is because merged menus cannot present the customized appearance that both Visual Studio and Office are capable of presenting.

Shortcut Menus

Shortcut menus provided by the Office application are available when the document is open in the Visual Studio environment, with the addition of a View Code shortcut menu item that opens the Code Editor.

Keyboard Shortcut Mapping

Keyboard shortcut mapping defaults to the Visual Studio mapping, but you can include Office mappings by changing the setting in the Options dialog box on the Tools menu. The setting is under the Microsoft Office Keyboard Settings node, under Microsoft Office Excel Keyboard or Microsoft Office Word Keyboard. Visual Studio Tools for Office also adds a toolbar to Visual Studio with a button that enables you to switch between the mapping options. The ToolTip text reads Switch to Excel Keyboard Scheme or Switch to Visual Studio Keyboard Scheme, depending on which option is currently enabled.

When you set this option in the Options dialog box, it becomes the default for all projects. However, any change will not take effect until after you close and reopen the project that is open while you make the change. If you use the toolbar button to change the setting, the change takes place immediately, but it only affects the current work session. If you close and reopen the project that is open while you make the change, or if you start a new project, the setting reverts to the default as set in the Options dialog box. In other words, use the toolbar button to make temporary changes to the keyboard settings, and use the Options dialog box to change the default behavior.

Embedded and Linked Objects

Documents that contain embedded or linked objects can be opened in Visual Studio. Selecting an embedded or linked object causes the menus to change to those of the selected object. However, there are no tools or support for customizing embedded or linked objects.

See Also

Concepts

Hidden Worksheets

Hidden Project Files in Solution Explorer

Office Documents in the Visual Studio Environment Overview

Reference

Microsoft Office Word Keyboard, Microsoft Office Keyboard Settings, Options Dialog Box

Microsoft Office Excel Keyboard, Microsoft Office Keyboard Settings, Options Dialog Box