Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XPath expression to a custom property in Word 2007 ?

From: "Kay-Christian Wessel" <kayhanse@------.-->
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 



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent