View Single Post
 
Old 06-07-2023, 04:42 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,166
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You will need to be explicit in providing the actual path. In VBA you could use
Code:
ThisDocument.Path & Application.PathSeparator & "My Doc.docx"  'or
ActiveDocument.Path & Application.PathSeparator & "My Doc.docx"
ThisDocument is the file where the macro is sitting
ActiveDocument is the document which is currently active (on top)
Application.PathSeparator is a tortuous way to write \ but we use it in case the code is being used on a Mac, in which case it becomes ":" because that is how a Mac separates folders
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote