Creating a Mail Merge Template using MS Word in C# and .NET


Introduction

We'll use MS Word to create a template document. It's the easiest way. By the way, you may even create a template document programmatically only using Document .Net API.

To start, open MS Word and create a new document or open an existing and save it to DOCX format. To make this document a real template we need to insert in it a one or more Merge Fields.

How to Insert a Merge Field using MS Word

  1. Select "INSERT" tab.
  2. Click by the pictogram "Quick Parts".
  3. Select and click by "Field.." menu item.
  4. In the opened window, follow to the "Field names:" and select "MergeField".
  5. In the "Field name:" type the name of your field, for example: Date. (Notice: You may specify a Format for this MergeField at your discretion).
  6. Click "OK".
How to create a template with Merge Fields in MS Word

Complete code


If you need a new code example or have a question: email us at support@sautinsoft.com or ask at Online Chat (right-bottom corner of this page) or use the Form below:


Captcha

Questions and suggestions from you are always welcome!

We are developing .Net components since 2002. We know PDF, DOCX, RTF, HTML, XLSX and Images formats. If you need any assistance with creating, modifying or converting documents in various formats, we can help you. We will write any code example for you absolutely free.