active template

F

Fred Kruger

can anyone tell me if its posible to find out what the template name is from
which a document is created from.

if i create a new document from template called minute is there vba code i
can use to see the template behind this document is called minute?
 
G

Graham Mayor

This is well documented in Word's vba help?

Set myTemplate = ActiveDocument.AttachedTemplate
MsgBox myTemplate.Path & Application.PathSeparator _
& myTemplate.Name

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
L

Lene Fredborg

The VBA code:
ActiveDocument.AttachedTemplate
returns the name of the template that is currently attached to the active
document.

Example:
If ActiveDocument.AttachedTemplate = "minute.dot" Then
'Do something
Else
'Do something else
End If


--
Regards
Lene Fredborg
DocTools – Denmark
www.thedoctools.com
Document automation – add-ins, macros and templates for Microsoft Word
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top