I have a very large number of documents that I need to change where they source the merge data from. I would prefer to change them as and when required.

The issue is knowing which I have changed and which I have not changed.

Is there a way I can readily see which data source is being used for the merge?


I found this suggestion somewhere on the stackexchange sites and can't find it again to refer you to, but it is pretty simple. If you use this much, put it in Normal.dot as a macro and have a button for any merge document you are in.

Sub find_datasource_for_mailmerge()
MsgBox ActiveDocument.MailMerge.DataSource.Name
End Sub

Sorry to necro, but this was the only useful hit on the first page of google results for me. Above answer from @datatoo was very helpful, and VB's autocomplete also led me to ActiveDocument.MailMerge.DataSource.QueryString to know which database object within the filename given by .Name was specifically being used, in the case when .Name only pointed as far as the filespec for an Access database.

  • 1
    Welcome to Super User! Please don't leave answers stating that you have the same problem as the one described in the question. If you have sufficient reputation, you may upvote the question. Alternatively, "star" it as a favorite and you will be notified of any new answers. – DavidPostill Nov 11 '16 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.