Excerpt |
---|
Opens and returns an existing Document from disk. |
Signature |
---|
C# | C# | Wiki Markup |
---|
{description}
{excerpt}Opens and returns an existing [Document|Document] from disk.{excerpt}
{signature:C#}
public Document Open(System.String fileName)
|
Signature |
---|
{signature}{signature:vb.net | vb.net | }
Public Function Open(ByVal fileName As String) As Document
|
...
The complete path and filename of the document to open from disk.
Returns |
---|
The document that is opened from disk. |
...
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 |
title | C# |
---|
{signature}
{parameters}
{param:fileName}The complete path and filename of the document to open from disk.{param}
{returns}The document that is opened from disk.{returns}
{exceptions}
{exception:System.Exception}Thrown if an error occurs while opening the document.{exception}
{remarks}Though the [WordTemplate|WordTemplate] object currently supports Office Open XML \(Word 2007\) format files, [WordApplication.Open()|WordApplication.Open] does not yet support them.
{remarks}
{example}{code:csharp|title=C#}
Document doc = app.Open("@C:\sample.doc");
Code Block |
---|
{code}
{code:vb.net
vb.net | title | |title=vb.net
}
Dim doc As Document = app.Open("C:\sample.doc"){code}
{example}