Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Feb 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Populating text fields and merging data (Word 2003)

    Hi
    This is probably very easy but im struggling to what is the best method to use. basically i have created a quotation temeplate with dropdown menus and text fields. depending on the slection from the dropdown menue i would like a text/paragraph to be inserted in the document. can you please help Thanks.
    If you need any more details please let me know

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

    Re: Populating text fields and merging data (Word 2003)

    Welcome to Woody's Lounge!

    Can you tell us what kind of dropdown menus and text boxes you have created? Are they from the Forms toolbar or from the Control Toolbox? Or something else?

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

    Re: Populating text fields and merging data (Word

    This sounds like an opportunity to use the autotextlist field type.

    <post:=605,334>post 605,334</post:> should get you started.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    New Lounger
    Join Date
    Feb 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Populating text fields and merging data (Word 2003)

    Hi thanks for the reply, im using text boxes and dropdown menus from the forms toolbar.thanks in advance

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

    Re: Populating text fields and merging data (Word 2003)

    You can create a macro (in a standard module) that checks the value of the dropdown. If appropriate, unprotect the document, insert text, then reprotect the document.
    Let's say that the bookmark name of the dropdown is MySelect and that it has items "Yes" and "No".
    Create a macro like this:
    <code>
    Sub DropdownAction()
    Select Case ActiveDocument.FormFields("MySelect").Result
    Case "Yes"
    ActiveDocument.Unprotect
    Selection.EndKey Unit:=wdLine
    Selection.TypeParagraph
    Selection.TypeText "This is a test of the emergency broadcasting system."
    Selection.TypeParagraph
    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
    Case "No"
    ' other code here
    End Select
    End Sub
    </code>
    Switch back to Word.
    Select DropdownAction as Exit macro for the MySelect dropdown.
    Protect the document and test.

  6. #6
    New Lounger
    Join Date
    Feb 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Populating text fields and merging data (Word 2003)

    Thanks so much that worked just fine.just one little problem at the moment it insert the text straight after the dropdown menu, what if i like to have the text from the downslection to go to a different page under a specific section .thanks again

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

    Re: Populating text fields and merging data (Word 2003)

    Perhaps you could create a bookmark there, and insert the text at the range of the bookmark.

Posting Permissions

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