|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
how to determine the full path of the template from which a document was created?
Let's say I can create a document from a template ("C:\some\arbitrary\path\mytemplate.dotm", for the sake of argument). How can I programmatically get the full path of the template from which the document was created?
|
#2
|
||||
|
||||
In the VBA window, click "Tools" and then "References...". Ensure that the checkbox next to the template in question is checked. To get the path of this template, use the following code:
Code:
mytemplate.ThisDocument.Path |
#3
|
||||
|
||||
The VBA code for retrieving the active document's template path is:
ActiveDocument.AttachedTemplate.Path
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Document Filename Generator for Referencing | john.adams | Word | 10 | 03-26-2013 12:14 AM |
Save Filename using Document Text | Knawl | Word | 11 | 10-10-2011 03:00 AM |
Office 2010 Template Loses Its Filename On Open | MYGS | Word | 14 | 06-02-2011 09:44 PM |
Macro to determine attached template | zippyaus | Word VBA | 0 | 03-02-2010 02:05 AM |
Word: The document 'Filename' caused a serious error the last time ... | martincruise | Word | 0 | 02-25-2010 01:47 AM |