Consulting

Results 1 to 4 of 4

Thread: HELP- Userforms and Templates

  1. #1
    VBAX Regular
    Joined
    Nov 2004
    Posts
    74
    Location

    HELP- Userforms and Templates

    Hello,

    I have designed some templates with VBA expresses help over the last few months. On testing I have found a problem, my templates are very unforgiving.

    Once a user has filled out the dialog box and submitted it, the data gets assigned to the appropriate bookmark. However if the user has made a typo they can't correct the document as it is protected. I would like the doc to be protected but not the text that has been summitted via the userform. Is there any way to assign a userform textbox to a 'text form field'?

    What I mean is that the text typed into the userform will be placed into a text form field instead of a bookmark therefore allowing the user to correct any mistakes in document.

    Any help would be much appreaciated.

    Thank you

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi,

    For a Formfield textbox use something like this in the Ok button of the UserForm:
    [VBA]
    ActiveDocument.Formfields("Textbox1").Result = Me.Textbox1.Text[/VBA]
    Enjoy!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  3. #3
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Hi newk. Is this working for you. If so, please mark the thread as solved.

    As Joost suggested, if you have a text formfield in the document you can take the information from the UserForm and put it into the formfield. The user can edit it as much as they need to, while still keeping the rest of the document protected and NOT editable.

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    I agree this is indeed the power of Formfields! write to them easily without having to unprotect/protect the document.

    I hope Newk has found what he was looking for...
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

Posting Permissions

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