CustomLabel Object

Description

Represents a custom mailing label. The CustomLabel object is a member of the CustomLabels collection. The CustomLabels collection contains all the custom mailing labels listed in the Label Options dialog box.

Using the CustomLabel Object

Use CustomLabels(index), where index is the custom label name or index number, to return a single CustomLabel object. The following example creates a new document with the custom label layout named "My Labels."

Set ML = Application.MailingLabel
If ML.CustomLabels("My Labels").Valid = True Then
    ML.CreateNewDocument Name:="My Labels"
Else
    MsgBox "The My Labels custom label is not available"
End If
The index number represents the position of the custom mailing label in the CustomLabels collection. The following example displays the name of the first custom mailing label.

If Application.MailingLabel.CustomLabels.Count >= 1 Then
    MsgBox Application.MailingLabel.CustomLabels(1).Name
End If
Use the Add method to create a custom label. The following example adds a custom mailing label named "My Label" and sets the page size.

Set ML = Application.MailingLabel.CustomLabels.Add(Name:="My Labels", _
    DotMatrix:=False)
ML.PageSize = wdCustomLabelA4
Properties

Application property, Creator property, DotMatrix property, Height property, HorizontalPitch property, Index property, Name property, NumberAcross property, NumberDown property, PageSize property, Parent property, SideMargin property, TopMargin property, Valid property, VerticalPitch property, Width property.

Methods

Delete method.