![]() |
#2
|
||||
|
||||
![]()
There is a better way to do this - put mapped Content Controls in the document where you want that data to be displayed. You can then either read or write to the first instance of each CC in the document to interact with the vba userform.
There are quite elegant templates to help with content controls (created by Greg Maxey and Graham Mayor which can be very useful if you are struggling with some of the concepts. If you add a few content controls to your first template and set them to be mapped to built-in properties then you can paste these into the other templates at the relevant locations. You can then include code to read/write to the CCs OR to the document properties. eg Code:
Sub DocProps() Dim aCC As ContentControl For Each aCC In ActiveDocument.ContentControls aCC.Range.Text = aCC.Title If aCC.XMLMapping.IsMapped Then aCC.Tag = aCC.XMLMapping.XPath End If Next aCC End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Open a document based on a template, the page numbers in the TOC won't update | billy8b8 | Word | 2 | 10-04-2015 06:06 AM |
![]() |
snickerbart | Outlook | 4 | 04-17-2015 12:55 PM |
Create scope-specific plans from Master Template | BobbyG | Project | 3 | 04-08-2015 06:15 AM |
![]() |
AndyR | PowerPoint | 3 | 09-25-2014 06:05 PM |
Does Word have an option to update fields AUTOMATICALLY at open??? | Jamal NUMAN | Word | 17 | 01-27-2012 12:57 AM |