CustomDocumentProperty

  • Thread starter Thread starter Mili
  • Start date Start date
M

Mili

Hi,
I am setting a custom document property for a PPT file.
Name of Custom Document Property is set to "propertyOne"

How to check in the macro if any Custom Doucment Property
is defined by name "propertyOne"

Thanks

Mili.
 
Mili said:
Hi,
I am setting a custom document property for a PPT file.
Name of Custom Document Property is set to "propertyOne"

How to check in the macro if any Custom Doucment Property
is defined by name "propertyOne"

Sub GetCustomProp()
msgbox CheckForCustomProp("propertyOne")
End Sub

Function CheckForCustomProp(strProperty as String) as String
' Returns "" if property not set or the value of the property otherwise

Dim X As Long

On Error Resume Next
With ActivePresentation.CustomDocumentProperties
For X = 1 To .Count
If .Item(X).Name = strProperty Then
CheckForCustomProp = .Item(X).Value
End If
Next X
End With

End Sub
 
Back
Top