View Single Post
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
[email protected] dennistiu@yahoo.com is offline
external usenet poster
 
Posts: 1
Default Validate Merge Fields

Basically I am using VBA to merge fields. I want to know if there is a
way to validate the merge fields specified in the document and the
available merge fields specified in the datasource:

Dim wrdApp As New
Microsoft.Office.Interop.Word.Application
wrdApp.ActiveDocument.MailMerge.OpenDataSource( *** My
data source information *** )
wrdApp.ActiveDocument.MailMerge.Destination =
wdSendToNewDocument
wrdApp.ActiveDocument.MailMerge.Execute()

I want to validate all the merge fields first before callign execute.
Is this possible?
The problem is if I have a specified merge field in the document that
is not in the datasource. Word displays a popup to warn me about the
invalid field. Since I am doing everything in the background, I have
no way of knowing the popup.

I see a check method but what does this do? It checks and then what?
It doesnt return anything or any boolean value to me

wrdApp.ActiveDocument.MailMerge.Check() - cant seem to know what this
will do?

Anyone have any ideas or suggestions?