Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View existing data source on Word 2007 document

Status
Not open for further replies.

TrivImp

Programmer
Jan 21, 2002
8
0
0
US
I have been tasked with documenting a legacy system that has a couple hundred Word documents as part of a mail merge routine. How do I view the data source for each document? The server is running Word 2007, although the documents were developed in an earlier version. I tried launching the mail merge wizard, which gives me a list of all possible data sources (we have six or eight configured) but doesn't tell me to which one the document is currently connected. I'm sure there's an easy trick that I'm overlooking, but I'm stuck!
 
Assuming the issue isn't that the files can't find their data sources, simply open them, answer 'Yes' to the mailmerge SQL prompt, then run the following macro:
Code:
Sub GetDataSourceName()
MsgBox ActiveDocument.MailMerge.DataSource.Name
End Sub

Cheers
Paul Edstein
[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top