Change Custom Properties with a Macro

M

Mickey

Hi,
I'm looking for a macro that will allow me to change 2 custom properties.
In all my documents I created 2 fields ("Approved Date") and ("Effective
Date"). When the document is re-submitted with changes I change both of the
field values from whatever the date is to "DRAFT". Is there a macro that can
do this?

Thanks,
Mickey
 
G

Greg Maxey

Try:
Sub ScratchMacro()
Dim oProp As DocumentProperties
Set oProp = ActiveDocument.CustomDocumentProperties
With oProp
.Item("Approved Date").Value = "Draft"
.Item("Effective Date").Value = "Draft"
End With
ActiveDocument.Fields.Update
End Sub
 
M

Mickey

Thank you so much. Works beautifully.

Greg Maxey said:
Try:
Sub ScratchMacro()
Dim oProp As DocumentProperties
Set oProp = ActiveDocument.CustomDocumentProperties
With oProp
.Item("Approved Date").Value = "Draft"
.Item("Effective Date").Value = "Draft"
End With
ActiveDocument.Fields.Update
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top