invalid merge field - trapping error

J

johan

when executing a mail-merge (vba) there's an error message "invalid
merge field" when the merge field is not in the database... the
error-handling routine in my vba-code seems not able to trap this
error... any advice ?
 
P

Peter Jamieson

You could consider getting your VBA to loop through each { MERGEFIELD }
field in the document, extract the merge field name, and ensure it exists in
the Document.MailMerge.DataSource.Datafields collection.
 
Top