Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 337
  • Last Modified:

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?
0
etech0
Asked:
etech0
1 Solution
 
GovvyCommented:
Openfiles | clip
0
 
etech0Author Commented:
can you be more specific?
0
 
GovvyCommented:
From command prompt type >openfiles /query
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
etech0Author Commented:
'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)
0
 
GovvyCommented:
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...
0
 
etech0Author Commented:
The link led to the same problem, and I don't see a solution on the 'help' list
0
 
GovvyCommented:
I meant run the help command to see if the openfiles tool is listed on your system...
0
 
etech0Author Commented:
Thanks.
I did, and it's not.
any other ideas?
0
 
Spike99On-Site IT TechnicianCommented:
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
0
 
etech0Author Commented:
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
0
 
GrahamSkanRetiredCommented:
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

0
 
etech0Author Commented:
"To run this macro,you need a reference to the Microsoft Forms 2.0 Object library"
How do I do this?
0
 
etech0Author Commented:
Thanks for all your help. I figured it out, though...

Sub getname()
Dim cltxt As DataObject
Set cltxt = New DataObject
Dim txt As String
txt = Right(ActiveDocument.Path, Len(ActiveDocument.Path) - InStrRev(ActiveDocument.Path, "\")) & _
 " - " & Left(ActiveDocument.Name, Len(ActiveDocument.Name) - InStrRev(ActiveDocument.Name, "."))
cltxt.SetText (txt)
cltxt.PutInClipboard
End Sub
0
 
etech0Author Commented:
I figured it out myself.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now