#1
|
|||
|
|||
How to Use XML Parts with .dotm
We use documents (.docm) that when opened pulls in information from our claim system. Using an XML part (http://schemas/company.net/ContentManagement.Claims), we are able to map information from our claims to the document using content controls. This would include information such as policy, claim, date of loss, policy, insured, etc. We use
Code:
Set objNode = ActiveDocument.CustomXMLParts.SelectByNamespace("http://schemas.company.net/ContentManagement.Claims").Item(1).DocumentElement I have tried "binding"(?) the xml part in the Sub Document_New code. Code:
Private Sub Document_New() Dim objNode As CustomXMLNode Set objNode = ActiveDocument.CustomXMLParts.SelectByNamespace("http://schemas.rlicorp.net/ContentManagement.Claims").Item(1).DocumentElement End Sub |
#2
|
||||
|
||||
Cross-posted at: vba - How to Use XML Parts with .dotm - Stack Overflow
For cross-posting etiquette, please read: Excelguru Help Site - A message to forum cross posters
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
||||
|
||||
Looking at the other thread linked by Paul, you have a bunch more information there that complicates this further. I'm not a member there so I'm not posting there.
Firstly, your docm files all have an 'attached template' so you can still house building blocks in Normal.dotm, the attached template or even an addin. If the docm files already have a common attached template then that would be the simplest place to put your building blocks. Secondly, are you trying to do all of this via code or do you want to use the Word GUI to link to the xml elements (fields)? Thirdly, the code shown for Document_New is not achieving anything let alone doing this... Quote:
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Tags |
template quickparts word, word 16, xml source |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Normal.dotm location? | gogreen | Word | 6 | 07-17-2016 09:45 AM |
Convert .dotm to .dotx | rogelinepaula | Word | 1 | 06-04-2015 09:39 PM |
.dotm available to all users? | donaldadams1951 | Word VBA | 3 | 05-06-2015 07:02 PM |
Location of normal.dotm | namedujour | Word | 3 | 04-25-2013 03:24 PM |
How to get to normal.dotm | Aiken_Bob | Word | 4 | 05-02-2011 02:41 PM |