CustomLabel Object
Word Developer Reference |
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.
Remarks
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 an existing custom label layout named "My Labels."
Visual Basic for Applications |
---|
|
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.
Visual Basic for Applications |
---|
|
Note |
---|
CustomLabel objects are sorted alphabetically in the CustomLabels collection and their index numbers are dynamically reassigned as the contents of the collection change. For that reason, it is safer to refer to a specific CustomLabel object by name rather than by index number. |
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.
Visual Basic for Applications |
---|
|
See Also