Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Apr 2005
    Location
    Smyrna, Georgia, USA
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Drop Down Box for Word (97)

    I am trying to create a Drop Down Box in Word

    Example: I want to be able to allow the person using this document to three choices. US, Canada, Mexio.

    How do I write the VBA for this?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Drop Down Box for Word (97)

    Do you prefer to display a dialog (VBA UserForm) and use VBA to insert the information into the document? That is the most work, but often gives the best user experience.

    In some cases, it is more appropriate to use Word's Forms features, having the drop-down control directly in the document. Word's Forms features are simpler to develop, but the side effects of protecting the document (necessary to activate the form controls) can be problematic for your users if they expect to have a lot of freedom to edit the document.

    A third possibility is to display custom toolbars. These are easier to design than UserForms, well suited to repetitive actions, and can be persistent so that the user does not need to run a procedure to get at the drop-downs. On the other hand, the user might interact with toolbar controls (executing code linked to them) at inappropriate or unpredictable times and in unexpected contexts, so they do not give the developer the same degree of control.

    So there are three kinds of drop-downs. Can you indicate the type you prefer?

    (P.S. I have trouble remembering much about the differences between Office 97 and more recent versions, so apologies if I have misstated the options available to you in your environment. I'm sure someone will correct me!)

  3. #3
    Lounger
    Join Date
    Apr 2005
    Location
    Smyrna, Georgia, USA
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop Down Box for Word (97)

    Since I am creating several drop down boxes I think I would go with VBA. That way I can copy the code changing only what I want in the drop down box.

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Drop Down Box for Word (97)

    For more information about designing a VBA UserForm, see this article: How to create a Userform. There are many other techniques for storing user input and causing it to appear in the document body, including Custom Document Properties and Document Variables. If your documents will end up going through a metadata cleaner, though, inserting the user's input as actual text probably is the safest. Does this help get you started? Please post back with any specific questions.

Posting Permissions

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