How would I create custom property in powerpoint through VBA Code. For
example, suppose I want all properties of a text box like height, width,
margins etc. and add those properties in document custom property tab.
From PPT's vba help:
Application.ActivePresentation.CustomDocumentProperties _
.Add Name:="Complete", LinkToContent:=False, _
Type:=msoPropertyTypeBoolean, Value:=False
But be very cautious about adding more than just a few of these. You can cause
other problems by stuffing too much into custom properties.
Instead, consider using presentation or slide-level tags.
ActivePresentation.Tags.Add "TagName", "TagValue"
Or for example, on a slide:
Dim oSh as Shape
Dim oSl as Slide
Set oSl = ActivePresentation.Slides(1)
Set oSh = oSl.Shapes("TextBoxName")
With oSh
oSl.Tags.Add "W", cStr(.Width)
osl.Tags.Add "H", cStr(.Height)
' and so on
End With
The slide now has tags named W and H etc, all strings.
To use them elsewhere, assuming you still have a reference to the slide in oSl
CDbl(oSl.Tags("W")) ' gives you the width