Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to modify a custom property, and if it not exists, create and give the value.
Public Sub UpdateCustomiProperty()
Dim oDoc As Document: Set oDoc = ThisApplication.ActiveDocument
Dim customPropSet As PropertySet
Set customPropSet = oDoc.PropertySets.Item("User Defined Properties")
Dim prop As Property
On Error Resume Next
Set prop = customPropSet.Item("MP")
If Err.Number <> 0 Then
Call customPropSet.Add(12345, "MP")
Else
prop.Value = 12345
End If
End Sub
Can someone explain why isn't working?
Solved! Go to Solution.