Results 1 to 15 of 15
  1. #1
    New Lounger
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Drop down boxes - for long sentences (2003)

    Can anyone provide help on creating a form with drop down boxes in Word for long sentences. I found maximum is about 12-15 characters. Not familiar with VB if this needs to be used. Any suggestions?

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

    Re: Drop down boxes - for long sentences (2003)

    The items in dropdown boxes from the Forms toolbars can be quite long (up to 255 characters), but since dropdowns cannot wrap across multiple lines, it is not useful to make the items very long. Would AutoText entries be an alternative?

  3. #3
    New Lounger
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop down boxes - for long sentences (2003)

    I need to create a protected form that will prompt the user to add from the list provided or add their own information. Will autotext do that? The final form is limited to one A4 page.

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

    Re: Drop down boxes - for long sentences (2003)

    AutoText will work in an unprotected section/part of the document, not in a protected section/part.

    (Just putting out ideas here) You could create a userform in the Visual Basic Editor with a dropdown list, or radio buttons with set phrases, and a command button to insert text into the document. This requires familiarity with VBA, though.

  5. #5
    New Lounger
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop down boxes - for long sentences (2003)

    Hans, very much appreciate you fast feedback. Are there simple codings available or examples available to create this in VB?

    Thanks
    Chris

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

    Re: Drop down boxes - for long sentences (2003)

    See the attached document. Make sure that macro security is not set to High, for that would disable the code in the document.

    You can look at the code behind the userform to see how the text is entered in the document.
    Attached Files Attached Files

  7. #7
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Drop down boxes - for long sentences (2003)

    Are you familiar with Autotextlist fields? This would allow you to select from multiple autotext entries (each of which may contain large amounts of text) by clicking on the field in your document.

    This might allow you to come up with a workable solution and avoid the need to code a solution in VBA.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  8. #8
    New Lounger
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop down boxes - for long sentences (2003)

    Hans, not sure what to do with the VB coding? Can I add / replace coding in one string of the VB for it to insert my data into the fields?

  9. #9
    New Lounger
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop down boxes - for long sentences (2003)

    Andrew, the autotext list may be workable. Can you widen the display to view full text / sentence prior to selecting data from the autotext list?

  10. #10
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Drop down boxes - for long sentences (2003)

    I'm not sure what exactly you can do with the autotextlist but the best summary of how to implement and use this is http://word.mvps.org/FAQs/TblsFldsFms/AutoTextList.htm
    Andrew Lockton, Chrysalis Design, Melbourne Australia

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

    Re: Drop down boxes - for long sentences (2003)

    You can modify the code any way you want. Not sure what you're asking, though.

  12. #12
    New Lounger
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop down boxes - for long sentences (2003)

    Hans, sorry. Don't know anything about VB. Any tips how I can edit the coding to make it work for me?

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

    Re: Drop down boxes - for long sentences (2003)

    Open the document, and close the form that appears (if you enabled macros).
    Press Alt+F11 to activate the Visual Basic Editor.
    In the Project Explorer on the left you'll see your document, with several items below it.
    Double click ThisDocument to see the code that is executed when the document opens:

    Private Sub Document_Open()
    UserForm1.Show
    End Sub

    This code displays the dialog form.
    Double click Userform1 to see the design of the dialog form. You can click on an item to select it. You will see its properties in the pane in the lower left of the window. For example, each option button (radio button) has a Caption property. This is the text displayed in the dialog, and also the text inserted into the document. Click in the Caption property to edit it.

    Use the buttons indicated in the screenshot below to switch between the design of the form and the code behind the form. You can also double click an item, for example one of the command buttons, to view and edit the associated code.
    Attached Images Attached Images
    • File Type: png x.PNG (21.0 KB, 3 views)

  14. #14
    New Lounger
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop down boxes - for long sentences (2003)

    Thanks Hans. I've created a drop down box with VB and it can opened in my word doc but am unsure how to put a text list in the box for selection. Any tips?

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

    Re: Drop down boxes - for long sentences (2003)

    How did you create the dropdown box and where?

Posting Permissions

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