Hello!
If I'm running a macro on a document that was created from a template, is
there a way to have the macro find out the name of the original template
document and store that name in a variable?
Later in the macro, I want to base a margin change on the original template
since I'm using a single macro to do something to documents created from
various templates.
For instance, when I'm using a macro to insert a landscape section in a
document created from my "8by11 Blank.dot" (which is portrait), the new
landscape section needs a left margin of 1.5", BUT if the document was
created from the template called "8by11 Proposal.dot" (also portrait) it
should get a left margin of 2.5".
Any help would be appreciated.
Thanks!
Peg
Jean-Guy Marcil - 08 Sep 2006 20:02 GMT
PegDalyPA via OfficeKB.com was telling us:
PegDalyPA via OfficeKB.com nous racontait que :
> Hello!
>
[quoted text clipped - 13 lines]
>
> Any help would be appreciated.
Have you tried:
Dim strDocTemplate As String
strDocTemplate = ActiveDocument.AttachedTemplate.Name

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
PegDalyPA - 08 Sep 2006 22:15 GMT
Thank you! That's the 2nd time you've saved me! :-)
Have a great weekend!
>PegDalyPA via OfficeKB.com was telling us:
>PegDalyPA via OfficeKB.com nous racontait que :
[quoted text clipped - 8 lines]
> Dim strDocTemplate As String
> strDocTemplate = ActiveDocument.AttachedTemplate.Name