Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / January 2004

Tip: Looking for answers? Try searching our database.

Datasource File Name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Tickler - 06 Jan 2004 12:06 GMT
How do I display the Data Source file name in the header of a mail merge
file?

Is there a Field Code that would do it?

------------------------------------------------
Peter Jamieson - 07 Jan 2004 10:28 GMT
> Is there a Field Code that would do it?

No.

You can get the file name using VBA, e.g.

ActiveDocument.MailMerge.DataSource.Name

and also use VBA to insert it in the header of the mail merge main document
/before/ you merge. A fairly easy way to do this would be to assign the
value to a Custome document property and use a DOCPROPERTY field in the
header of the mail merge main document. If you are using Word 2002 or later
you could consider using a MailMerge event to do this.

(NB, if the data source is not a "file" data source (.txt, .doc, .mdb) but
is (say) an ODBC connection to an SQL Server database, then .Name may be
blank)

--
Peter Jamieson - Word MVP
Word MVP web site http://www.mvps.org/word

> How do I display the Data Source file name in the header of a mail merge
> file?
>
> Is there a Field Code that would do it?
>
> ------------------------------------------------
Cindy M  -WordMVP- - 07 Jan 2004 11:12 GMT
Hi Peter,

> How do I display the Data Source file name in the header of a mail merge
> file?
>  
> Is there a Field Code that would do it?

No, there's nothing provided directly in Word that can do this for you.
You'd need to use a macro.

Which version of Word are you using, and what data source file type(s)?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.