Document.XMLSchemaReferences Property (2007 System)
Gets an XMLSchemaReferences collection that represents the schemas attached to the document.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property XMLSchemaReferences As XMLSchemaReferences
'Usage
Dim instance As Document
Dim value As XMLSchemaReferences
value = instance.XMLSchemaReferences
[BrowsableAttribute(false)]
public XMLSchemaReferences XMLSchemaReferences { get; }
[BrowsableAttribute(false)]
public:
property XMLSchemaReferences^ XMLSchemaReferences {
XMLSchemaReferences^ get ();
}
public function get XMLSchemaReferences () : XMLSchemaReferences
Property Value
Type: XMLSchemaReferences
An XMLSchemaReferences collection that represents the schemas attached to the document.
Examples
The following code example displays the URI of each of the XML schemas referenced in the document.
This example is for a document-level customization.
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 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.