1

How I can get full path of current document into clipboard when working with Microsoft Office applications? I'm mostly interested in Word and Excel.

Example:

I have open the following file in Excel:

D:\Data\Customer\Contoso\2014-12-01_Specifications.xlsx

Expected result in clipboard after getting the path:

D:\Data\Customer\Contoso\2014-12-01_Specifications.xlsx
0

4 Answers 4

4

Place Document Location textbox on the Quick Access Toolbar. When you click there the full path can be copied.

How-to: In Excel Options window -> Quick Access Toolbar section, you can find this element in group Commands Not in the Ribbon. Highlight it and click Add >> button.

Described in How-To Show The Location of a File in the Quick Access Toolbar.

2
  • 1
    I accepted this answer because it gives "heavy-duty" solution. For whoever who doesn't like adding field to toolbar, you can use one-off answer for Office 2010+ or Office 2003-2007. Coders can try this.
    – miroxlav
    Feb 13, 2015 at 12:15
  • 1
    This is the most efficient method suggested so far. After adding Document Location to Quick Access, you can copy the path to the clipboard using Alt+<Number>, Ctrl+C. Nov 16, 2017 at 15:09
1

Excel maybe you can use this function (I can't test it):

LEFT(CELL("filename"),FIND("]",CELL("filename"),1)) 

For path without name of file:

cell("filename")

In Excel VBA you can use:

ThisWorkbook.Path

VBA complet and tested:

Sub aaaaa()
MsgBox ActiveDocument.Path & Application.PathSeparator & _
 ActiveDocument.Name
End Sub
5
  • maybe use also this link
    – Jerry1
    Feb 12, 2015 at 15:07
  • These are working, BUT I'm trying to imagine my attempts to recall the correct formula or VBA statement if I'm in hurry and need just that path quickly. Was it Document or ThisDocument or Workbook or ThisWorkbook? :)
    – miroxlav
    Feb 12, 2015 at 15:12
  • I edit my post, just look.
    – Jerry1
    Feb 12, 2015 at 15:14
  • that Sub is nice but VBA macros attached to application throw warnings on every application launch because I have no certificates etc... Didn't Microsoft built in some easy out-of-the-box way achievable without coding?
    – miroxlav
    Feb 12, 2015 at 15:20
  • Finally, I've found proper way which needs only clicking the mouse.
    – miroxlav
    Feb 12, 2015 at 15:29
1

I found the feature available for this purpose since Office 2007.
The steps below can be used in Office 2010 and higher :

  1. Open File backstage menu.

  2. Click Properties at the top of the rightmost column.

  3. Click Show Document Panel menu item.

  4. At top right corner of Document panel, there is a Location field.

  5. Copy content of the field into the clipboard.

1
1

In both Microsoft Word and Excel, you can get the path to the current document in the Document Information Panel.

Press Alt+F+E+P

The path to the current document is in the Location field in the top, right-hand corner. Triple-click the path and copy it to your clipboard as desired.

Verified on Word/Excel 2003/2007 on Windows.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .