Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-12-2017, 03:00 AM
MANOHAR MANOHAR is offline Get path of newly opened word document Windows 7 32bit Get path of newly opened word document Office 2007
Advanced Beginner
Get path of newly opened word document
 
Join Date: Jan 2017
Posts: 33
MANOHAR is on a distinguished road
Default Get path of newly opened word document

Hello,

How can i get the file path of newly opened document without saving it?

Thanks
Manohar
Reply With Quote
  #2  
Old 04-12-2017, 03:41 AM
gmayor's Avatar
gmayor gmayor is offline Get path of newly opened word document Windows 10 Get path of newly opened word document Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
What EXACTLY is it that you are trying to do?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 04-12-2017, 06:07 AM
macropod's Avatar
macropod macropod is online now Get path of newly opened word document Windows 7 64bit Get path of newly opened word document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get path of newly opened word document Word document saved with two columns only shows one column when next opened. Trevor C Word 2 08-25-2016 04:54 AM
Get path of newly opened word document Lost word document now opened in unknown Danwordman Word 2 07-07-2015 05:03 AM
Get path of newly opened word document 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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft