Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: XPath expression to a custom property in Word 2007 ? >Thread Next - Re: XPath expression to a custom property in Word 2007 ? Re: XPath expression to a custom property in Word 2007 ?To: NULL Date: 11/8/2008 9:50:00 PM Here is the mapping to the core properties :
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)
Here is the core property file :
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <cp:coreProperties
xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:dcmitype="http://purl.org/dc/dcmitype/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dc:creator>Kay</dc:creator>
<cp:lastModifiedBy>Kay</cp:lastModifiedBy>
<cp:revision>5</cp:revision>
<dcterms:created
xsi:type="dcterms:W3CDTF">2008-11-08T18:23:00Z</dcterms:created>
<dcterms:modified
xsi:type="dcterms:W3CDTF">2008-11-08T18:33:00Z</dcterms:modified>
</cp:coreProperties>
I was hoping to do the same against the custom property file :
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <Properties
xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
- <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="2"
name="MyFirstCustomProperty">
<vt:lpwstr>David Jaffe</vt:lpwstr>
</property>
- <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="3"
name="MySecondCustomProperty">
<vt:lpwstr>SecondText</vt:lpwstr>
</property>
</Properties>
Kay
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
