Page tree

Versions Compared

Key

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

...

Info
titleFollowing the Sample Code

In the downloadable WordWriter_Basic_Tutorials.zip, there is a completed template file located in BusinessLabels/templates/Business_Label_Template.docx.

The template file looks like this:

Image Added

There is a table with fields for an employee's FirstName, MI, LastName, Phone, Email, Street, City, State, and ZipCode. These fields are repeated for an entire page in the document. The goal is to populate all of the business labels, but spill onto multiple pages as necessary.

Unlike with repeat blocks that are populated with WordTemplate.SetRepeatBlock, which require bookmarks to determine what part of the document is repeated, WordTemplate.SetMailMerge treats the entire document as a repeat block, so it is not necessary to add bookmarks when using SetMailMerge.

Adding a WordWriter Reference in Visual Studio

Info
titleFollowing the Sample Code

In the sample code, the reference to SoftArtisans.OfficeWriter.WordWriter.dll has already been added to the BusinessLabels web application project.

To create a .NET project and add a reference to the WordWriter library:

1. Open Visual Studio and create a .NET project.
2. Add a reference to the SoftArtisans.OfficeWriter.WordWriter.dll

  • SoftArtisans.OfficeWriter.WordWriter.dll is located under Program Files > SoftArtisans > OfficeWriter > dotnet > bin.

Writing the Code

Adding NEXT fields

...