Page tree

Versions Compared

Key

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

Excerpt

Passes a document from WordApplication to WordTemplate.

Signature
C#C#
Wiki Markup
{description}
{excerpt}Passes a document from [WordApplication|WordApplication] to [WordTemplate|WordTemplate].{excerpt}
{signature:C#}
 public void Open(WordApplication aApp, Document aDoc)
Signature
{signature}{signature:vb.net
vb.net
}
Public Sub Open(ByVal aApp As WordApplication, ByVal aDoc As Document)
Parameters

...

The instance of WordApplication that was used to create the document.

...

A Document object representing the Word file created with WordApplication.

Remarks

You can use WordApplication to create a document with merge fields (a template) and pass the file to WordTemplate to populate the merge fields.

{signature}
{parameters}
{param:aApp}The instance of {{WordApplication}} that was used to create the document.{param}
{param:aDoc}A [Document|Document] object representing the Word file created with [WordApplication|WordApplication].{param}
{remarks}You can use {{WordApplication}} to create a document with merge fields \(a template\) and pass the file to {{WordTemplate}} to populate the merge fields.

{remarks}
{example}{code:csharp|title=C#}

          WordApplication wwApp = new WordApplication();
          Document doc = wwApp.Create();
          WordTemplate wwTmpl = New WordTemplate();
          wwTmpl.Open(wwApp, doc);
        
{code}
{code:vb.net
|title=vb.net
}

          Dim wwApp As New WordApplication()
          Dim doc As Document = wwApp.Create()
          Dim wwTmpl As New WordTemplate()
          wwTmpl.Open(wwApp, doc)
        {code}

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