How to: Open Existing 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 Open(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) method opens the existing Microsoft Office Word document specified by a fully qualified path and file name. This method returns a Document.

To open a document

To open a document as read-only

Compiling the Code

This code example requires the following:

  • A document named NewDocument.doc must exist in a directory named Test on drive C.

See Also

Tasks

How to: Create New Documents

How to: Close Documents

Concepts

The Variable missing and Optional Parameters in Office Solutions