Page tree

Versions Compared

Key

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

...

Remarks

You can call SetMailMerge once for each instance of WordTemplate. If you are using the Excel 2003 binary template file type (.xls/.xlt), you can call SetMailMerge or SetRepeatBlock, but not both.

Additionally, only the page content is repeated for each row, not the entire page itself. If you wish to have the page itself repeat for each row, you will need to remember to place a page break at the bottom of the page.

If you wish to have the page itself repeat for each row, you will need to remember to place a page break at the bottom of the page.  Alternatively, you can create a hidden page break at the top of the page as follows:

  • Put the cursor at the top of the document
  • Go to Page Layout and open the paragraph formatting dialog
  • On the Line and Page Breaks tab,  select "Page Break Before"

Merge Fields for using the SetMailMerge method must not specify a data source – the data source is implied, and using a data source name will cause WordTemplate to throw an error. Valid merge field formats for use with SetMailMerge include field names («fieldname») and field ordinals («#1»).

...