Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jun 2001
    Location
    Vancouver, Br. Columbia
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word 2007 - populate drop-down entries in form (Word 2007)

    I have a Startup template, which contains several entries saved as building
    blocks in the autotext gallery, in a custom category called MailingOptions.

    In another template, I have a dialog box that runs from an AutoNew macro.
    In that dialog box, I want a drop-down (combo box) that displays all the autotext entries
    that are in the MailingOptions category in the Startup template.

    Can anyone provide the code that will populate the combo box?

    Thanks...
    Adri

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Word 2007 - populate drop-down entries in form (Word 2007)

    Does this do what you want?

    Private Sub UserForm_Initialize()
    Dim ate As AutoTextEntry
    For Each ate In Templates("MyGlobalTemplate.dot").AutoTextEntries
    If ate.StyleName = "MailingOptions" Then
    Me.ComboBox1.AddItem ate.Name
    End If
    Next ate
    End Sub

    Replace MyGlobalTemplate with the name of the startup template, and ComboBox1 with the name of the combo box.

  3. #3
    Star Lounger
    Join Date
    Jun 2001
    Location
    Vancouver, Br. Columbia
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word 2007 - populate drop-down entries in form (Word 2007)

    Hans,

    Thanks so much for this. It's close, but in 2007 the object is BuildingBlocks or BuildingBlockEntries, not AutoTextEntries, and uses Category, not style. I'll work on converting it for 2007 and let you know.

    Adrienne

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •