ged125
asked on
Word 2007 Macro to Update Document Properties
Can anyone out there provide some sample code that I could use to prompt and collect values for custom document properties and then do an update of all the fields throughout the doc? I have a document that has several variables that I currently go in and manually enter, then I do a "CTRL-A" to select all the text and right click and select "Update Fields".
Is there a way that I could run a macro, be prompted for all the values and then the document would generate itself?
Thanks in advance.
Is there a way that I could run a macro, be prompted for all the values and then the document would generate itself?
Thanks in advance.
ASKER
would it be possible to get the complete code?
ASKER
application.customdocument properties isn't available for me. Any idea why?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's what I was looking for! Thanks Chris!
The essence of the update is:
application.customdocument
application.customdocument
...
followed by
a loop
for each story in activedocument.storyranges
story.select
story.fields.update
selection.collapse direction:=wdcollapsestart
next
myform.hide
application.saved = false
Any help?
Chris