Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

Opens and returns an existing Document from disk.

Signature
C#
C#
 public Document Open(System.String fileName)
Signature
vb.net
vb.net
Public Function Open(ByVal fileName As String) As Document
Parameters
Param
fileName
fileName

The complete path and filename of the document to open from disk.

Returns

The document that is opened from disk.

Exceptions
Exception
System.Exception
System.Exception

Thrown if an error occurs while opening the document.

Remarks

Though the WordTemplate object currently supports Office Open XML (Word 2007) format files, WordApplication.Open() does not yet support them.

Example
Code Block
csharp
csharp
titleC#
Document doc = app.Open("@C:\sample.doc");
Code Block
vb.net
vb.net
titlevb.net
Dim doc As Document = app.Open("C:\sample.doc")