Simon Woods was telling us:
Simon Woods nous racontait que :
Hi
Is there an object in the Word object model which exposes a
collection of all the label specification found in Word. It is
obviously available to Word, but has it been made available to vba?
Thanks
Simon
Are you writing about Caption Labels, as in:
'_______________________________________
Dim lblCUrrent As CaptionLabels
Dim i As Long
Set lblCUrrent = Application.CaptionLabels
For i = 1 To lblCUrrent.Count
MsgBox lblCUrrent(i).Name
Next
'_______________________________________
Or, mailing labels?
In this case, you have a custom label collection but no collection for all
the hundreds of built in labels that exists. See:
'_______________________________________
Dim myMailLbl As MailingLabel
Dim myCustLbl As CustomLabels
Dim i As Long
Set myMailLbl = Application.MailingLabel
Set myCustLbl = Application.MailingLabel.CustomLabels
MsgBox myMailLbl.DefaultLabelName
If myCustLbl.Count > 0 Then
For i = 1 To myCustLbl.Count
MsgBox myCustLbl(i).Name
Next
End If
'_______________________________________
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org