會傳回 XMLMapping 物件,表示內容控制項與文件資料存放區中 XML 資料之間的對應。 唯讀。
語法
expression。 XMLMapping
詞 一個回傳 ContentControl 物件的表達式。
範例
下列範例會設定內建的 Author 文件屬性並將新的內容控制項加入至使用中文件,然後將此控制項的對應設定為內建文件屬性的值。
Dim objCC As ContentControl
Dim objMap As XMLMapping
Dim blnMap As Boolean
ActiveDocument.BuiltInDocumentProperties("Author").Value = "David Jaffe"
Set objCC = ActiveDocument.ContentControls.Add _
(wdContentControlText, ActiveDocument.Paragraphs(1).Range)
Set objMap = objCC.XMLMapping
blnMap = objMap.SetMapping(XPath:="/ns1:coreProperties[1]/ns0:creator[1]")
If blnMap = False Then
MsgBox "Unable to map the content control."
End If
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。