G
Greg Maxey
Does anyone know if or where Microsoft has published any "real" help with
regards to working with ContentControls. Particularly the area of mapping?
For example the Help topic on: XMLMapping.SetMappingByNode Method
Provides the following example:
The following example sets the built-in document property for the document
author, inserts a new content control into the active document, and then
sets the XML mapping for the control to the built-in document property.
Visual Basic for Applications
Dim objcc As ContentControl
Dim objNode As CustomXMLNode
Dim objMap As XMLMapping
Dim blnMap As Boolean
ActiveDocument.BuiltInDocumentProperties("Author").Value = "David Jaffe"
Set objcc = ActiveDocument.ContentControls.Add _
(wdContentControlDate, ActiveDocument.Paragraphs(1).Range)
Set objNode = ActiveDocument.CustomXMLParts.SelectByNamespace _
("http://schemas.openxmlformats.org/package/2006/metadata/core-properties")
_
(1).DocumentElement.ChildNodes(1)
Set objMap = objcc.XMLMapping
blnMap = objMap.SetMappingByNode(objNode)
All well and good and works like a charm. The problem is that it offers no
real help on deciphering the gobbledygook contained in the "Set objNode"
line. Unless one read this example how would anyone guess how to craft that
statement? What if one wanted to map to another built-in docproperty. How
does one determine the "ChildNode" number of the other properties?
regards to working with ContentControls. Particularly the area of mapping?
For example the Help topic on: XMLMapping.SetMappingByNode Method
Provides the following example:
The following example sets the built-in document property for the document
author, inserts a new content control into the active document, and then
sets the XML mapping for the control to the built-in document property.
Visual Basic for Applications
Dim objcc As ContentControl
Dim objNode As CustomXMLNode
Dim objMap As XMLMapping
Dim blnMap As Boolean
ActiveDocument.BuiltInDocumentProperties("Author").Value = "David Jaffe"
Set objcc = ActiveDocument.ContentControls.Add _
(wdContentControlDate, ActiveDocument.Paragraphs(1).Range)
Set objNode = ActiveDocument.CustomXMLParts.SelectByNamespace _
("http://schemas.openxmlformats.org/package/2006/metadata/core-properties")
_
(1).DocumentElement.ChildNodes(1)
Set objMap = objcc.XMLMapping
blnMap = objMap.SetMappingByNode(objNode)
All well and good and works like a charm. The problem is that it offers no
real help on deciphering the gobbledygook contained in the "Set objNode"
line. Unless one read this example how would anyone guess how to craft that
statement? What if one wanted to map to another built-in docproperty. How
does one determine the "ChildNode" number of the other properties?