This is an old thread, but a user has reported that the macro I posted doesn't actually work, at least not with the latest versions of my (or Greg's) add-ins. The reason appears to be that simply changing the document property with the posted code is not seen by the document as something that needs to be saved, and so it isn't. So to use it you need to change the code to flag it as unsaved as shown below.
Code:
Option Explicit
Function DocProp(oDoc As Document) As Boolean
Dim oProp As DocumentProperty
Dim bProp As Boolean
Const strName As String = "Department"
Const strValue As String = "Money"
Const lngType As Long = 4 'Text
On Error GoTo err_Handler
bProp = False
For Each oProp In oDoc.CustomDocumentProperties
If oProp.Name = strName Then
oProp.value = strValue
bProp = True
Exit For
End If
Next oProp
If Not bProp Then
oDoc.CustomDocumentProperties.Add _
Name:=strName, _
LinkToContent:=False, _
value:=strValue, _
Type:=lngType
End If
For Each oProp In oDoc.CustomDocumentProperties
If oProp.Name = strName Then
oProp.value = strValue
Exit For
End If
Next oProp
oDoc.Saved = False
DocProp = True
lbl_Exit:
Exit Function
err_Handler:
DocProp = False
Resume lbl_Exit
End Function
P.S. As this issue may arise again, I have now updated the add-in to version 4.3 to force the save in the Custom Process code so that any process which does not allow Word to see a change, will actually force the document to be saved regardless.
https://www.gmayor.com/document_batch_processes.htm