Thread: [Solved] Macros on other computers
View Single Post
 
Old 03-06-2011, 06:57 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Hi Bryan,
Quote:
Originally Posted by judicial85 View Post
Thank you Paul! But like I said, I'm fairly weak in VBA and coding... what is the "english translation" of ActiveDocument.Path?
ActiveDocument.Path is a vba expression that returns the path to the active document. It is especially useful where you want to work on a file that's kept in the same folder as the document you're working on. Where the file you're working on is in a different, though related, folder, you can add code to strip off the unwanted parts and add on such additional (known) portions that you might need.

ActiveDocument.Path will typically return a string like:
C:/Users/Bryan/My Documents
so, if you wanted:
C:/Users/Bryan/Desktop
you could use the vba Replace command to change 'My Documents' to 'Desktop', and the ActiveDocument.Path expression combined with the Replace command would then work equally well for: C:/Users/Danny/Desktop;
C:/Users/Tina/Desktop; and
C:/Users/Becky/Desktop,
etc.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote