Link to home
Start Free TrialLog in
Avatar of etech0
etech0Flag for United States of America

asked on

copy file name and folder name to clipboard

Hi!
I'm looking for an easy way to copy the filename and folder (location) of an open document to the clipboard, (ideally from the save as box)
Can anyone help?
Avatar of Govvy
Govvy
Flag of United States of America image

Openfiles | clip
Avatar of etech0

ASKER

can you be more specific?
From command prompt type >openfiles /query
Avatar of etech0

ASKER

'openfiles' is not recognized as an internal or external command, operable program, or batch file

(I'm using windows xp - if it makes a difference)
It should be available in XP: http://technet.microsoft.com/en-us/library/bb490961.aspx

Type 'help' at command prompt and check if it is in the list...
Avatar of etech0

ASKER

The link led to the same problem, and I don't see a solution on the 'help' list
I meant run the help command to see if the openfiles tool is listed on your system...
Avatar of etech0

ASKER

Thanks.
I did, and it's not.
any other ideas?
Avatar of Spike99
Which version of Word is it?

In Office 2010, you can click on File > Info to see the full path of the file. Single click to highlight the full path & then you can copy/paste.

In Office 2007, click on the round Office logo button > Prepare > Properties.  The full path is at the top of the window.  Either double click the path to highlight it or  single click, then CNTRL+SHIFT+Arrow keys to highlight the entire path..

In Office 2003, click on View > Toolbars > Web to enable the web toolbar. Single click on the path to highlight, then copy it.

Alicia
Avatar of etech0

ASKER

Spike99: Thanks for your help. However, I'm looking for a solution that would save me time. These ideas take longer than it would take me to just retype the folder name, and copy the filename from the save as dialog box.
Maybe a macro would be able to copy the folder name and filename? (I don't want the whole path, just the folder that the file is in.)
Thanks
To run this macro,you need a reference to the Microsoft Forms 2.0 Object library. This will already be set if you have a userform in the template
Sub ToClipboard()
    Dim fld As Field
    Dim dob As New DataObject
    'dob.SetText ActiveDocument.FullName
    'dob.SetText ActiveDocument.Path
    dob.PutInClipboard
End Sub

Open in new window

Avatar of etech0

ASKER

"To run this macro,you need a reference to the Microsoft Forms 2.0 Object library"
How do I do this?
ASKER CERTIFIED SOLUTION
Avatar of etech0
etech0
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of etech0

ASKER

I figured it out myself.