Path for datasource

M

Markus

Anyone know how I can find what the name and path is to the current
datasource for a mailmerge document from inside Word? I am using Word 2003.

Many thanks,
Mark
 
S

Suzanne S. Barnhill

I'm not sure you can. If you select "Open Data Source" on the Mail Merge
toolbar, it wants to connect you to a new source rather than show you the
existing one, and there's nothing in the document Properties that tells. But
this might be an idea going forward: add the path to the data source to the
Comments field in the Properties (or possibly even set it as the Hyperlink
Base).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
J

Jay Freedman

The current source is available through the macro editor. Press
Alt+F11 to open the editor, and press Ctrl+G to open the Immediate
window at the bottom right. Copy the following line, paste it into the
Immediate window, and press Enter:

?ActiveDocument.MailMerge.DataSource.Name

The path and file name will appear on the next line.

If you want a permanently saved macro to which you can assign a
toolbar or Quick Access Toolbar button, put this into the Normal
template (see http://www.gmayor.com/installing_macro.htm if needed):

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

Clicking the button to run the macro will display the path and file in
a message box.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
S

Suzanne S. Barnhill

Thanks for that, Jay. I should have known it would be available through VBA!

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
M

Markus

Thanks Jay. This works well. However, I remember a long time ago I learned
of a way to display the path and file name in the task pane. I remember it
was an option buried a couple levels down, that you could toggle on. Can't
seem to locate it now tho, but I am sure it was there.

Any recollection of this option in your experience?

Thanks again,
Mark
 
J

Jay Freedman

Hi Mark,

I don't know of an option like that, but I've never used mail merge
very much so that's not surprising. It could easily be something that
was in an older version but was later dropped -- it's hard to keep up
with the changes over the years.
 
S

Suzanne S. Barnhill

It may well have existed before Microsoft introduced the My Data Sources
folder that Open Data Source insists on defaulting to, regardless of where
the attached data source is.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
P

Peter Jamieson

Isn't it displayed in step 3 of the MailMerge task pane?

Not sure you could ever set an option of the kind you mention. You
could, however, get more details of the mailmerge data source by going
to Word->Help->System Info. But you have to wait...

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv
 
M

Markus

Ok. Maybe it was in an earlier version. I know it was awhile ago. Serves
me right for not writing it down.

Thanks,
Mark
 
P

Peter Jamieson

You could be thinking of the Mail Merge Helper, which you can enable in
Word 2003 by going to Tools->Customize->Commands, select "All Commands"
from the Categories list on the left, then look for Mail Merge Helper in
the list on the right and drag that command to a toolbar (e.g., the Mail
Merge toolbar, if it is displayed.

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top