Conditional Document Merge

I created a MS Word report based on several word documents. Each are handled by a specific class and returns the Document to a report driver class that merges all the return Documents into one report.

Is there a way when a document is returned from one of my classes that I can tell if that class actually populated the document?

I am looking for a way to check the returned Document to see if the class that handled it actually populated it. If not, then I will not merge it.

I want to handle it in this manner vs. having my method return true for merge. I know I can pass the document as well to the other classes and handle the merge there but really did not want to go that route.

Hi Patrick,

Thanks for your inquiry.

If you are expecting every merge field in the document to be merged then you could try checking the number of fields left in the document using the GetFieldNames method.

If this method returns a count > 0 then the mail merge was not completed successfully.

Thank,s

Adam,

This did the trick!