Get current file name and path from current word doc

C

CAD Fiend

Hello,

I am working with putting hyperlinks in an Access database field (setup
for hyperlinks) and wanted to know if anyone has written (or knows of a
way) a macro to get the following two objects from the current workspace
window, first: file name, and second: file path, and then put them both
together as a string to the clipboard so I can paste it to the database
field.

Or, as an alternative, is there a way to straight into the directory
(using explorer) and get it from there quickly? I don't want to have to
do a bunch of clicking and copying and pasting functions by hand.

TIA.

Phil.
 
J

Jay Freedman

CAD said:
Hello,

I am working with putting hyperlinks in an Access database field
(setup for hyperlinks) and wanted to know if anyone has written (or
knows of a way) a macro to get the following two objects from the
current workspace window, first: file name, and second: file path,
and then put them both together as a string to the clipboard so I can
paste it to the database field.

Or, as an alternative, is there a way to straight into the directory
(using explorer) and get it from there quickly? I don't want to have
to do a bunch of clicking and copying and pasting functions by hand.

TIA.

Phil.

The complete path-and-filename string of the current document is the value
of the property ActiveDocument.FullName.

It seems unusual to need to go through the clipboard to fill a database
field, but if that's what you need, see
http://word.mvps.org/FAQs/MacrosVBA/ManipulateClipboard.htm.
 
N

need_some_help

Hi Jay,

Is that true for finding the pathname alone? Could I say
ActiveDocument.Pathname?

Sorry to intrude on the thread
Thanks
 

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