Word Document Project Template
The features in this topic are available only if you have the required applications installed.
For more information, see.
The Word Document project template in Visual Basic and Visual C# provides the groundwork for applications that target new or existing Microsoft Office Word 2003 documents. The template automatically adds the necessary project references, files, and basic code to use as a starting point for your application.
Some of the files and references listed below are hidden by default. To see them, click Show All Files on Solution Explorer.
There are some files and references not listed below that are common to many Visual Studio project templates.
The following methods are included in the project template code file.
Startup is called after the document is running and all the initialization code in the assembly has been run. It is the last thing to run in the constructor of the class that your code is running in.
Shutdown is called when the application domain that your code is loaded in is about to unload. It is the last thing to be called in the class as it unloads.
These are the main user files. They are visible by default.
You cannot add additional classes to the code file behind a document, workbook, or worksheet. You must add new files to your project to contain any classes you want to write.
WordDocument1.doc - Represents the Word document in the project. Contains the document design surface and the code file.
ThisDocument (.vb file for Visual Basic or .cs file for Visual C#) - A document that provides the design surface and the code file. For more information, see.
Microsoft Visual Studio 2005 Tools for the Microsoft Office System generates these hidden files. Do not modify these files manually; they are regenerated when changes are made to the project and they do not retain manual modifications.
.Designer.xml - A read-only declarative representation of the programmable objects in the document.
.Designer (.vb file for Visual Basic or .cs file for Visual C#) - A read-only code file that provides helper implementations, including code to instantiate objects correctly.
<Document Name>.Designer.xml - A read-only declarative representation of programmable objects such as custom controls that are not a part of Visual Studio Tools for Office by default.
<Document Name>.Designer (.vb file for Visual Basic or .cs file for Visual C#) - A read-only code file that provides helper implementations for custom controls.
Microsoft.Office.Core - The primary interop assembly for shared Office components.
Microsoft.Office.Tools.Common - A collection of helper implementations for developing actions pane and smart tags solutions.
Microsoft.Office.Interop.Word - The primary interop assembly for Word.
Microsoft.Office.Tools.Word - Implementations of Word controls and managed controls.
Microsoft.VisualStudio.Tools.Applications.Runtime - The component that loads the main project assembly in Word.
Microsoft .NET Framework assemblies - A collection of references to some of the Microsoft .NET Framework assemblies that are used when developing Visual Studio Tools for Office solutions.