XMLMapping.XPath Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a String that represents the XPath for the XML mapping, which evaluates to the currently mapped XML node. Read-only.
public:
property System::String ^ XPath { System::String ^ get(); };
public string XPath { get; }
member this.XPath : string
Public ReadOnly Property XPath As String
Property Value
Examples
The following example checks whether the first content control in the active document is a date control and whether the XPath string is set to a specific built-in document property. It then sets the mapping to the control, if the XPath does not match and the control is a date control.
<span class="label">Dim objCC As ContentControl
Dim objMap As XMLMapping
Dim blnMap As Boolean
Set objCC = ActiveDocument.ContentControls(1)
Set objMap = objCC.XMLMapping
If (objCC.Type = wdContentControlDate) And (objMap.</span>
<span class="label">XPath</span>
<span class="label"><> _ "/ns1:coreProperties[1]/ns0:createdate[1]") Then blnMap = objMap.SetMapping(XPath:="/ns1:coreProperties[1]/ns0:createdate[1]") If blnMap = False Then MsgBox "Unable to map the content control." End IfEnd If</span>
Remarks
To set mapping for a content control, use the SetMapping(String, String, CustomXMLPart) method or the SetMappingByNode(CustomXMLNode) method. If the mapping is not active, using this property returns an error.
Applies to
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기