Working with Documents

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

  • Application-level projects

Microsoft Office version

  • Word 2003

  • Word 2007

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

The topics in this section provide step-by-step procedures and code examples for using the object model of Microsoft Office Word to work with documents in Visual Studio Tools for Office projects. 

In some cases, the ways that you perform these tasks in application-level add-ins is different from the ways that you perform them in document-level customizations.

Task

Procedure

Create a document based on Normal.dot or a different template.

How to: Create New Documents

Open a specified document as read/write or read-only.

How to: Open Existing Documents

Close the active document or a specified document.

How to: Close Documents

Save a document with the same name or a new name.

How to: Save Documents

Print an entire document or only the current page.

How to: Print Documents

Display the print preview for a document.

How to: Display Documents in Print Preview

Access a specific document when multiple documents are open.

How to: Reference Documents in the Documents Collection

Display a built-in dialog box and collect user input.

How to: Use Built-In Dialog Boxes in Word

Use functionality in a built-in dialog box without displaying it.

How to: Use Word Dialog Boxes in Hidden Mode

Add a picture or Word Art to a document.

How to: Add Pictures and Word Art to Documents

Prevent users from editing a document or a part of a document.

How to: Protect Documents and Parts of Documents

Check spelling.

How to: Check Spelling in Documents

Add a header or footer to a document.

How to: Add Headers and Footers to Documents

Remove all comments from a document.

How to: Remove All Comments from Documents

See Also

Concepts

Word Object Model Overview

Office Solutions Development Overview