Discussion:
Is the Open Document a Template
(too old to reply)
Michael Tissington
2007-02-17 03:32:05 UTC
Permalink
I need to display a custom ribbon only if the user is creating a template.

How do I know if the Active Document is a template (need to know for Word
2003 and 2007) ?
Jay Freedman
2007-02-16 22:04:06 UTC
Permalink
Post by Michael Tissington
I need to display a custom ribbon only if the user is creating a template.
How do I know if the Active Document is a template (need to know for
Word 2003 and 2007) ?
In VBA -- definitely in Word 2003, and probably also in 2007 although I
won't be able to check for a few hours -- you can look at the value of
ActiveDocument.Type. It could have values of wdTypeDocument (a constant
equal to 0) or wdTypeTemplate ( = 1) or wdTypeFrameset ( = 2).

I don't know whether there's some "native" way of doing this in RibbonX, or
if you'll have to write a callback procedure in VBA. Look at
http://www.pschmid.net/office2007/ribbonx/index.php for help with this.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
Michael Tissington
2007-02-19 17:14:32 UTC
Permalink
Thanks, just what I was looking for.

Loading...