共用方式為


DocumentBase.XMLSchemaReferences 屬性

取得 XMLSchemaReferences 集合,表示附加至文件的結構描述。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)

語法

'宣告
Public ReadOnly Property XMLSchemaReferences As XMLSchemaReferences
public XMLSchemaReferences XMLSchemaReferences { get; }

屬性值

型別:Microsoft.Office.Interop.Word.XMLSchemaReferences
XMLSchemaReferences 集合,表示附加至文件的結構描述。

範例

下列程式碼範例會顯示文件中所參考之每個 XML 結構描述的 URI。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

Private Sub DocumentXMLSchemaReferences()
    Dim stringBuilder1 As New System.Text.StringBuilder()

    ' Add all of the schema URIs to the StringBuilder.
    Dim schema As Word.XMLSchemaReference
    For Each schema In Me.XMLSchemaReferences
        stringBuilder1.Append(schema.NamespaceURI & ", ")
    Next schema

    ' End the StringBuilder with a period.
    stringBuilder1.Remove(stringBuilder1.Length - 2, 2)
    stringBuilder1.Append(".")

    MessageBox.Show("The document contains " & Me.XMLSchemaReferences.Count.ToString() _
        & " schema(s): " & stringBuilder1.ToString())
End Sub 
private void DocumentXMLSchemaReferences()
{
    System.Text.StringBuilder stringBuilder1 =
        new System.Text.StringBuilder();

    // Add all of the schema URIs to the StringBuilder.
    foreach (Word.XMLSchemaReference schema in
        this.XMLSchemaReferences)
    {
        stringBuilder1.Append(schema.NamespaceURI + ", ");
    }

    // End the StringBuilder with a period.
    stringBuilder1.Remove(stringBuilder1.Length - 2, 2);
    stringBuilder1.Append(".");

    MessageBox.Show("The document contains " +
        this.XMLSchemaReferences.Count.ToString() +
        " schema(s): " + stringBuilder1.ToString());
}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間