مشاركة عبر


DocumentBase.Type الخاصية

يحصل على نوع مستند (قالب أو مستند).

مساحة الاسم:  Microsoft.Office.Tools.Word
التجميع:  Microsoft.Office.Tools.Word.v4.0.Utilities (في Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

بناء الجملة

'إقرار
Public ReadOnly Property Type As WdDocumentType
    Get
public WdDocumentType Type { get; }

قيمة الخاصية

النوع: Microsoft.Office.Interop.Word.WdDocumentType
واحد WdDocumentTypeقيم.

أمثلة

مثال التعليمة البرمجية التالية بعرض رسالة تقوم بعرض نوع مستند. إلى لاستخدام هذا المثال، قم بتشغيلها من ThisDocumentالفئة في مشروع المستوى مستند.

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.

راجع أيضًَا

المرجع

DocumentBase الفئة

DocumentBase الأعضاء

Microsoft.Office.Tools.Word مساحة الاسم