Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

Takes a WordTemplate object representing a template Word file, and opens the file as a Document object.

Signature
C#C#
Wiki Markup
{description}
{excerpt}Takes a [WordTemplate|WordTemplate] object representing a template Word file, and opens the file as a [Document|Document] object.{excerpt}
{signature:C#}
 public Document Open(WordTemplate wwt)
Signature
{signature}{signature:vb.net
vb.net
}
Public Function Open(ByVal wwt As WordTemplate) As Document
Parameters

...

A WordTemplate object representing a template Word file.

Returns

The Word file that was passed from WordTemplate to WordApplication.

Exceptions

...

Thrown if an error occurs while opening the template.

Remarks

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

{signature}
{parameters}
{param:wwt}A {{WordTemplate}} object representing a template Word file.{param}
{returns}The Word file that was passed from {{WordTemplate}} to [WordApplication|WordApplication].{returns}
{exceptions}
{exception:System.Exception}Thrown if an error occurs while opening the template.{exception}
{remarks}Though the {{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#}

          WordTemplate wTempl = new WordTemplate();
          ...
          wTempl.Process();
          WordApplication wApp = new WordApplication();
          Document doc = wApp.Open(wTempl);
          ...
        
{code}
{code:vb.net
|title=vb.net
}

          Dim wTempl As New WordTemplate()
          ...
          wTempl.Process()
          Dim wApp As New WordApplication()
          Dim doc As Document = wApp.Open(wTempl)
        {code}

{example}
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle