Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2006

Tip: Looking for answers? Try searching our database.

active template

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fred Kruger - 29 Dec 2006 11:04 GMT
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?
Graham Mayor - 29 Dec 2006 12:12 GMT
This is well documented in Word's vba help?

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

Signature

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> 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?
Lene Fredborg - 29 Dec 2006 12:15 GMT
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

Signature

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

> 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?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.