Właściwość DocumentBase.XMLSchemaReferences —
Pobiera XMLSchemaReferences , która reprezentuje schematy dołączonym do dokumentu.
Przestrzeń nazw: Microsoft.Office.Tools.Word
Zestaw: Microsoft.Office.Tools.Word.v4.0.Utilities (w Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
Składnia
'Deklaracja
Public ReadOnly Property XMLSchemaReferences As XMLSchemaReferences
public XMLSchemaReferences XMLSchemaReferences { get; }
Wartość właściwości
Typ: Microsoft.Office.Interop.Word.XMLSchemaReferences
XMLSchemaReferences , Która reprezentuje schematy dołączonym do dokumentu.
Przykłady
Poniższy przykład kodu wyświetla identyfikator URI każdej ze schematów XML, do którego odwołuje się dokument.Aby wykorzystać ten przykład, należy uruchomić go z ThisDocument klasy w projekcie na poziomie dokumentu.
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());
}
Zabezpieczenia programu .NET Framework
- Pełne zaufanie do bezpośredniego wywołującego. Tego elementu członkowskiego nie można używać w kodzie częściowo zaufanym. Aby uzyskać więcej informacji, zobacz Przy użyciu bibliotek z częściowo zaufanego kodu..