Partager via


Document.SelectSingleNode(String, String, Boolean) Méthode

Définition

Retourne un objet XMLNode représentant le premier nœud dans le document qui correspond au paramètre XPath.

public Microsoft.Office.Interop.Word.XMLNode SelectSingleNode(string XPath, string PrefixMapping = "", bool FastSearchSkippingTextNodes = true);
abstract member SelectSingleNode : string * string * bool -> Microsoft.Office.Interop.Word.XMLNode
Public Function SelectSingleNode (XPath As String, Optional PrefixMapping As String = "", Optional FastSearchSkippingTextNodes As Boolean = true) As XMLNode

Paramètres

XPath
String

Chaîne XPath valide. Pour plus d'informations sur XPath, consultez Référence XPath.

PrefixMapping
String

Fournit le préfixe dans le schéma selon lequel effectuer la recherche. Utilisez le PrefixMapping paramètre si votre XPath paramètre utilise des noms pour rechercher des éléments.

FastSearchSkippingTextNodes
Boolean

true ignore tous les nœuds de texte pendant la recherche du nœud spécifié. false inclut des nœuds de texte dans la recherche. La valeur par défaut est false.

Retours

Objet XMLNode qui représente le premier nœud correspondant au paramètre XPath dans le document ; null si aucun nœud correspondant au paramètre XPath n'est trouvé.

Remarques

La définition du FastSearchSkippingTextNodes paramètre sur true diminue les performances, car Microsoft Office Word recherche tous les nœuds d’un document par rapport au texte contenu dans le nœud.

Paramètres facultatifs

Pour plus d’informations sur les paramètres facultatifs, consultez Paramètres facultatifs dans les solutions Office.

S’applique à