#1
|
|||
|
|||
Get path of newly opened word document
Hello, How can i get the file path of newly opened document without saving it? Thanks Manohar |
#2
|
||||
|
||||
If it is a document that has never been saved it doesn't have a path.
If it was opened from a location on the hard drive, that location is the path. It can be easily shown with a single line of macro code Code:
Sub GetPath() MsgBox ActiveDocument.Path End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
||||
|
||||
You could also use File|SaveAs. For a previously-saved document, the dialogue will show the Save As dialogue will show the existing path; for a new document, it will show the default save path.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word document saved with two columns only shows one column when next opened. | Trevor C | Word | 2 | 08-25-2016 04:54 AM |
Lost word document now opened in unknown | Danwordman | Word | 2 | 07-07-2015 05:03 AM |
Word Template is not recognised when opened by double click. Creates new document. | stevewak | Word | 8 | 03-19-2014 05:12 AM |
Word counting macro for newly added portion? | New Daddy | Word VBA | 24 | 09-30-2013 07:30 PM |
Programmatically get File Path for currently opened WORD document | franferns | Word | 1 | 11-26-2009 12:36 PM |