Solved

Use same XML multiple times in Word Document

Posted on 2011-03-10
5
236 Views
Last Modified: 2012-05-11
Do you know if there's a simple way to use the same XML elements multiple times in a Word document? Best illustrated with an example:

Say XML snippit is

<Release>
  <ReleaseNo>2.80</ReleaseNo>
  ....
</Release>

I take the XML and apply a transform to format the release information into a release document but I need to use the release number at various points throughout the resulting document. I had expected to be able to bookmark an XML element and then use that bookmark at other points on the doc, but bookmarking an XML element creates a reference the entire element, not the contents hence using the bookmark anywhere else invalidates the template document. For example, creating a bookmark to the <ReleaseNo> place-holder and then adding a cross-reference to it, cause Word to enter another <ReleaseNo> place holder elsewhere and this is out of context of the XML structure.

So is there a simple way to take say the value of the <ReleaseNo> element and store it in Word so it can be used/cross-referenced elsewhere?

Thanks

0
Comment
Question by:regisit
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:zlatev
ID: 35375462
Can you please give an example (ideally in an attached word document) as to how you are using the XML currently from your word document?
0
 

Accepted Solution

by:
regisit earned 0 total points
ID: 35375902
Thanks for responding, but this Q was raised a month ago. I've reverted to a bit of VBA to extract the XML text into a custom document property and then insert this as field into various other points in the document. Not ideal, but as far as I could tell - no other way around this. Looked at using Content Controls, but this seems a half-baked facilty too so discounted that quickly.

This is a sensitive document so could not publish here, hence what I thought was a reasonable outline of the issue.

0
 
LVL 8

Expert Comment

by:zlatev
ID: 35378226
Fair enough. I was not requesting to release some confidential info, just trimmed down POC of what you are trying to achieve.
0
 
LVL 8

Expert Comment

by:zlatev
ID: 35378243
Also you have not mentioned content controls in your intial question, so I was kind of confused as to how you are refering to xmls from word.
0
 

Author Closing Comment

by:regisit
ID: 35410243
?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SharePoint 2013 Blog Template 2 31
RSS is valid, but improvement recommendations are confusing. 3 42
C# SQL BULK INSERT CLASS 5 46
Create html table using xsl 8 28
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now