There are two views in the designer: Design view and Code view. Some of the functionality of these two views is the same no matter which Office application is open in the Visual Studio environment. Some functionality depends on whether Word or Excel is currently open.
Design View
Design view is the graphical view of the document and application. The Office document opens in the designer. The designer enables you to access the Office Ribbon groups, menus, and toolbars, and to design the document without having to go outside of the Visual Studio environment. If your project uses Microsoft Office 2003 as the target version, Word and Excel 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. If your project uses the 2007 Microsoft Office system as the target version, the Ribbon appears in the designer just above the document.
You can edit and modify a document or workbook by using the native functionality of the Office application, for example by using Undo, writing Excel formulas, and using the Find feature of Office. You can also use the Visual Studio tool windows and editors to customize the document or workbook using managed code. Keyboard shortcut mapping defaults to the Visual Studio mapping, but you can include Office mappings by changing the setting in the Options dialog on the Tools menu, under the Microsoft Office Keyboard Settings node.
You can drag controls from the Visual Studio Toolbox onto the document design surface, and modify the control properties using the Properties window. Double-clicking the control will open the Code view with an automatically generated event handler. Controls that are not visible in the document appear in the component tray during design time.
Word and Excel have a design mode that enables customizations that cannot be performed during the normal run-time mode. When a document is open in the Visual Studio environment, it is always in design mode. To view the document in run-time mode, you must open the application and the document outside of Visual Studio. You can also build and run the project, which will automatically open the document and application outside of Visual Studio.
Code View
The Code Editor associated with the document in the designer is the same as the Code Editor you find behind Windows Forms. For more information, see Code and Text Editor.
Excel
Each Excel worksheet has a design view that is a normal worksheet, and the design view of the workbook is a large component tray that fills the designer. The worksheet tabs appear at the bottom of the worksheets, and you can navigate from one to another by clicking the tabs as you would in Excel. There is also a code file associated with each worksheet and with the workbook.
When you write code behind a worksheet or the workbook, your code is local to that object. However, you can access the other objects by using Globals in your code. For more information, see Global Access to Objects in Visual Studio Tools for Office Projects.
When you double-click a normal worksheet cell, the cell switches to edit mode. When you double-click a cell that contains a host control, the code editor opens and the default event handler is generated. For more information about host controls, see Host Items and Host Controls Overview.
Word
There is only one design view for Word documents, which is the document itself. When you double-click the document surface, your cursor moves to that location as usual in Word. Similarly, when you double-click a word, that word is selected. However, if the word is inside a host control, the code editor opens and the default event handler for the control is generated. For more information about host controls, see Host Items and Host Controls Overview.