• Determine Document Type (Word XP)

    Author
    Topic
    #418439

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #941825

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

      If ActiveDocument.Type = wdTypeTemplate Then

      • #941829

        Thank you – works perfectly clapping

      • #941875

        Hi Jefferson,

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

        Cheers

        Cheers,
        Paul Edstein
        [Fmr MS MVP - Word]

    Viewing 0 reply threads
    Reply To: Determine Document Type (Word XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: