Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    create drop list (MS word 2003)

    how to create the drop list?
    i using the MS wrod 2003 control toolbar, the add combo box,but the drop list is empty.
    I try looking the properties,but nothing i can add.

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

    Re: create drop list (MS word 2003)

    Welcome to Woody's Lounge!

    You can create two kinds of dropdown lists in Word: from the Forms toolbar and from the Control Toolbox.

    The dropdown list from the Forms toolbar can be populated by double clicking it. But you have to protect the document for forms in order to use the dropdown list (click the "Lock" button on the Forms toolbar to protect/unprotect the document). This may be too restrictive for your purposes.

    The dropdown list from the Control Toolbox can only be populated using VBA code, for example when the document is opened. You can create a Document_Open event procedure in the ThisDocument module:

    Private Sub Document_Open()
    With Me.ComboBox1
    .AddItem "This"
    .AddItem "That"
    .AddItem "Other"
    End With
    End Sub

    See the attached sample document.

  3. #3
    New Lounger
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: create drop list (MS word 2003)

    thanks,i know how to create the conbo list,
    but it is empty, i don;t know where to add the input, like pass,fail..etc
    when click the list,it is blank.

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

    Re: create drop list (MS word 2003)

    If you create combo box from the Control Toolbox, the only way to add entries to the dropdown list is by using VBA code, you cannot enter them manually. I gave an example of how to use code to fill the list in my previous reply.

  5. #5
    New Lounger
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: create drop list (MS word 2003)

    ya..i added the code as below,but the pull down list is still empty,
    it should contain "this","that","other".
    Am i right?

    Private Sub Document_Open()
    With Me.ComboBox1
    .AddItem "This"
    .AddItem "That"
    .AddItem "Other"
    End With
    End Sub

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

    Re: create drop list (MS word 2003)

    Did you put the code in the ThisDocument module? It won't work if you put it in a standard module.
    And if you did put it in ThisDocument, did you save, close and reopen the document? The code runs (or should run) when the document is opened.
    Also, check Tools | Macro | Security and make sure that the macro security level is not set to (Very) High, for that will disable all VBA code. The best setting is Medium; you'll then be prompted whether you want to allow macros - click Enable.

  7. #7
    New Lounger
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: create drop list (MS word 2003)

    oh..thanks
    after enable macro,it works pretty.
    thanks your help.

Posting Permissions

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