Expand Minimize

Document.SelectSingleNode Method

Returns a Microsoft.Office.Interop.Word.XMLNode object that represents the first node in the document that matches the XPath parameter.

Namespace:  Microsoft.Office.Tools.Word
Assemblies:   Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

XMLNode SelectSingleNode(
	string XPath,
	string PrefixMapping,
	bool FastSearchSkippingTextNodes


Type: System.String

A valid XPath string. For more information about XPath, see XPath Reference.

Type: System.String

Provides the prefix in the schema against which to perform the search. Use the PrefixMapping parameter if your XPath parameter uses names to search for elements.

Type: System.Boolean

true skips all text nodes while searching for the specified node. false includes text nodes in the search. Default value is false.

Return Value

Type: Microsoft.Office.Interop.Word.XMLNode
A Microsoft.Office.Interop.Word.XMLNode object that represents the first node that matches the XPath parameter in the document; null if no nodes matching the XPath parameter are found.

Setting the FastSearchSkippingTextNodes parameter to true diminishes performance because Microsoft Office Word searches all nodes in a document against the text contained in the node.

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft