Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Gets the document type (template or document).
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
Syntax
'Declaration
Public ReadOnly Property Type As WdDocumentType
Get
public WdDocumentType Type { get; }
Property Value
Type: Microsoft.Office.Interop.Word.WdDocumentType
One of the WdDocumentType values.
Examples
The following code example displays a message that shows the document type. To use this example, run it from the ThisDocument class in a document-level project.
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
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;
}
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.