Quote:
Originally Posted by nschroeder
I like where you're going, but I'm not sure how to get there. I'm an Excel/Access/VBA guy, but haven't done much in Word/VBA. I figured out how to create a custom Bor1Name property, but it doesn't show up in Quick Parts - Document Properties, so that would imply that the only way to access custom properties is through code. Could you please give more specifics about how to create and update custom properties through code, and then how to use them to populate table fields? I tried to record creating the property, but the macro came up blank.
Thanks for your help.
|
having created your custom Bor1Name property, you can reference it anywhere in the document via a DOCPROPERTY field, which you can create via Ctrl-F9, then typing 'DOCPROPERY Bor1Name' between the field braces, thus: {DOCPROPERTY Bor1Name}, then pressing F9 to update. Adding fields through code isn't particularly difficult either.
For some code examples using custom document properties, see:
https://www.msofficeforums.com/word-...numbering.html
https://www.msofficeforums.com/word-...ent+propert%2A
https://www.msofficeforums.com/word/...ferencing.html
A thread that discusses both mapped content controls and the use of custom document properties is:
https://www.msofficeforums.com/word-...t-control.html
Although the above examples don't involve other applications (eg Access/Excel), the code for the Word side of things would be much the same - automating Word from those other apps isn't especially complicated.