Edit

CustomLabels.Add method (Word)

Adds a custom mailing label to the CustomLabels collection. Returns a CustomLabel object that represents the custom mailing label.

Syntax

expression.Add (Name, DotMatrix)

expression Required. A variable that represents a 'CustomLabels' collection.

Parameters

Name Required/Optional Data type Description
Name Required String The name for the custom mailing labels.
DotMatrix Optional Variant True to have the mailing labels printed on a dot-matrix printer.

Return value

CustomLabel

Example

This example adds a custom mailing label named Return Address, sets the page size, and then creates a page of these labels.

Sub ReturnAddrLabel() 
 Dim ml As CustomLabel 
 Dim addr As String 
 
 Set ml = Application.MailingLabel.CustomLabels _ 
 .Add(Name:="Return Address", DotMatrix:=False) 
 ml.PageSize = wdCustomLabelLetter 
 addr = "Dave Edson" & vbCr & "123 Skye St." & vbCr _ 
 & "Our Town, WA 98004" 
 Application.MailingLabel.CreateNewDocument _ 
 Name:="Return Address", Address:=addr, ExtractAddress:=False 
End Sub

See also

CustomLabels Collection Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.