Share via


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

Concepts

CustomLabels Collection Object

CustomLabels Object Members