Class CaptionLabels (Word VBA)

A collection of CaptionLabel objects that represent the available caption labels. The items in the CaptionLabels collection are listed in the Label box in the Caption dialog box. To use a CaptionLabels class variable it first needs to be instantiated, for example


Dim cls as CaptionLabels
Set cls = CaptionLabels

For Each

Here is an example of processing the CaptionLabels items in a collection.


Dim cll As CaptionLabel
For Each cll In CaptionLabels
	
Next cll

Add

Returns a CaptionLabel object that represents a custom caption label.

Add (Name)

Name: The name of the custom caption label.


Sub CapLbl() 
 CaptionLabels.Add Name:="Demo Slide" 
End Sub

Count

Returns a Long that represents the number of caption labels in the collection.


Dim lngCount As Long
lngCount = CaptionLabels.Count

Item

Returns an individual CaptionLabel object in a collection.

Item (Index)

Index: The individual object to be returned. Can be a Long indicating the ordinal position or a String representing the name of the individual object.


Dim cll As CaptionLabel
Set cll = CaptionLabels(Index:=1)