Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Christchurch, New Zealand
    Posts
    250
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Determine Document Type (Word XP)

    Is there anyway to programmatically determine whether a file is a template or a document? I have been sent some "templates" - they all have the .dot extension, but when I use Save As it gives me the option to Save as file type: Word document. I believe that this means the file is actually a document, just named with the .dot extension, and thus has all attributes of a document not a template.

    Comments/suggestions would be appreciated.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Determine Document Type (Word XP)

    I used to do this in a convoluted way, but as of Word 2002, you can use:

    If ActiveDocument.Type = wdTypeTemplate Then

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Christchurch, New Zealand
    Posts
    250
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Determine Document Type (Word XP)

    Thank you - works perfectly <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

  4. #4
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Determine Document Type (Word XP)

    Hi Jefferson,

    The wdTypeTemplate property is also supported in Word 2000 - just in case anyone's concerned with backwards compatability.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •