DocumentBase.XMLSchemaReferences Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient une collection XMLSchemaReferences qui représente les schémas attachés au document.
public Microsoft.Office.Interop.Word.XMLSchemaReferences XMLSchemaReferences { get; }
Valeur de propriété
Collection XMLSchemaReferences qui représente les schémas attachés au document.
Exemples
L’exemple de code suivant affiche l’URI de chacun des schémas XML référencés dans le document. Pour utiliser cet exemple, exécutez-le à partir de la ThisDocument classe dans un projet au niveau du document.
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());
}
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