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
 

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

Back
Top