Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

Returns the names of all merge fields in the main document.

Signature
C#
C#
<table class="diff-macro"><thead><tr><th class="diff-macro-title">unmigrated-wiki-markup</th></tr></thead><tbody><tr><td class="diff-macro-body"><pre>
 public System.String[] FieldMarkers{ get; }
</pre></td></tr></tbody></table>
Signature
vb.net
vb.net
Public <p>Public ReadOnly Property FieldMarkers() As String()</p>
Remarks

The main document is any part of the template that is not within a repeat block. (A repeat block is a fragment in the template document - defined by a Word bookmark - that contains merge fields and that will be repeated for each row in a data source.)

Example
Code Block
csharp
csharp
titleC#
            //--- Create the WordTemplate object.
          WordTemplate oWW = new WordTemplate();

          //--- Open a template using a string.
          oWW.Open(@"C:\template.doc");

          //--- Get all the merge fields in the document.
          String[] allMergefields = oWW.FieldMarkers;
        
Code Block
vb.net
vb.net
titlevb.net
            '--- Create the WordTemplate object.
          Dim oWW As New WordTemplate()

          '--- Open a template using a string.
          oWW.Open("C:\template.doc")

          '--- Get all the merge fields in the document.
          Dim allMergefields As String() = oWW.FieldMarkers