Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Nov 2008
    Location
    Sydney, New South Wales, Australia
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Text Box size matches table cell (2003/SP3)

    Hi all,

    I am building a template and want to use the ControlBox controls rather than form fields. The form is table based and I want to have a Text Box within a table cell and expands in size vertically as the user types. The field should always be the width of the containing cell as a FormField would work.

    The results I am experiencing are:
    * With Autosize = False, MultiLine = True and ScrollBars: The textbox remains the initial width but as more text than can fit on the one line is entered the scroll bar appears
    * With Autosize = true, MultiLine = True: Even though at design time the width is set to the width of the cell as soon as text is entered the textbox resizes to 1 character wide and adds new lines each of 1 character
    * With AutoSize = true, multiline = false: The textbox resizes only horizontally and not vertically

    I know that I could trap the change even on the TextBox and check the width and resize it both horizontally and vertically but this is very clunky and appears "jerky" to the user.

    Any help is as always appreciated
    Regards
    Ross

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

    Re: Text Box size matches table cell (2003/SP3)

    Could you explain why you want to use text boxes from the Control Toolbox? You're making life difficult for yourself and for your users because these controls are not native to Word.

  3. #3
    New Lounger
    Join Date
    Nov 2008
    Location
    Sydney, New South Wales, Australia
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Box size matches table cell (2003/SP3)

    Sure Hans,

    I need to be able to retrieve and update the content of the fields based on the entered information. I initially developed the form using form fields however updating and retrieving information is both slow and makes the form jump around. I tried using the LockWindowUpdate API however it didn't help when retrieving information. The way the form is now with Controls rather than formfields is faster and the user experience better

    Regards
    Ross

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

    Re: Text Box size matches table cell (2003/SP3)

    Sorry to harp on this, but in what way does retrieving information from form fields make the form jump around?

  5. #5
    New Lounger
    Join Date
    Nov 2008
    Location
    Sydney, New South Wales, Australia
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Box size matches table cell (2003/SP3)

    No problems Hans,

    If I am doing this the wrong way and there is a better way I am more than happy to hear it. As you say the ControlBox tools are more complicated particularly as VBA does not support control arrays. Also, given my development background I tender to resort to code rather than word features.

    The form is about 5 pages long and when I reference a field on the second page the document "flicks" to that page and then back.

    Regards
    Ross

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

    Re: Text Box size matches table cell (2003/SP3)

    It's true that Word jumps to the location of the formfield, but on my almost 6 year old and relatively slow PC it's so fast that it's hardly noticeable - I only see the scroll bar flash very briefly.

    Have you considered collecting the information on a userform (created in the Visual Basic Editor)?

  7. #7
    New Lounger
    Join Date
    Nov 2008
    Location
    Sydney, New South Wales, Australia
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Box size matches table cell (2003/SP3)

    Hans the form is about 30 Questions long with each one having 5 fields which react to others

    I had thought about a UserForm but the length would detract from the userbility and I would need to just make it a standalone application which would be overkill for what I require. I could also make each Question a UserForm but this is a clinky way of doing things by having a pop-up on each question.

    Regards
    Ross

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

    Re: Text Box size matches table cell (2003/SP3)

    Some other ideas:
    - Let the user enter the text directly in table cells (in an unprotected section/document).
    - Use an Access database.

Posting Permissions

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