I am not that experienced in VB.NET. I am working on a application where i have to perform mail merge from the application. The application lets the userwrite letters, save them as rtf file. In letter, tags are added programmatically for fields to add data while merging. User can use the letter later to perform mail merge on it to selected customers. Customers dataset is ready.
Now, can any one assist me how to move further to perform the mail merge stuff. Till now, I have a letter with tags in it like <<CompanyName>>, etc and a dataset with list of records. I have started off with the code ;
Expand|Select|Wrap|Line Numbers
- Private Sub PerformMailMerge()
- Dim wApp As New Word.Application
- Dim wDoc As Word.Document
- Dim wMailMerge As Word.MailMerge
- wDoc = wApp.Documents.Open(Me.CapFileName)
- wApp.Visible = True
- wDoc.Unprotect()
- wDoc.MailMerge.Destination = Word.WdMailMergeDestination.wdSendToNewDocument
- wDoc.MailMerge.Execute()
Any help is appreciated. Please.
Thanks