Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Reference
 Type Property (2007 System)
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual Studio Tools for Office API Reference
Document..::.Type Property (2007 System)

Gets the document type (template or document).

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Visual Basic (Declaration)
Public ReadOnly Property Type As WdDocumentType
Visual Basic (Usage)
Dim instance As Document
Dim value As WdDocumentType

value = instance.Type
C#
public WdDocumentType Type { get; }

Property Value

Type: WdDocumentType
One of the WdDocumentType values.

The following code example displays a message that shows the document type.

This example is for a document-level customization.

Visual Basic
Private Sub DocumentType()
    Select Case Me.Type
        Case Word.WdDocumentType.wdTypeDocument
            MessageBox.Show("The document is a normal" & "  Word document.")

        Case Word.WdDocumentType.wdTypeFrameset
            MessageBox.Show("The document is a frameset.")

        Case Word.WdDocumentType.wdTypeTemplate
            MessageBox.Show("The document is a template.")

        Case Else
            MessageBox.Show("The document type could not" & " be discovered.")
    End Select
End Sub

C#
private void DocumentType()
{
    switch (this.Type)
    {
        case Word.WdDocumentType.wdTypeDocument:
            MessageBox.Show("The document is a normal" +
            "  Word document.");
            break;

        case Word.WdDocumentType.wdTypeFrameset:
            MessageBox.Show("The document is a frameset.");
            break;

        case Word.WdDocumentType.wdTypeTemplate:
            MessageBox.Show("The document is a template.");
            break;

        default:
            MessageBox.Show("The document type could not" +
                " be discovered.");
            break;
    }
}

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker