Consulting

Results 1 to 8 of 8

Thread: content control in userform

  1. #1

    content control in userform

    hi, I want to know if its possible to have a userform drop down list, and based on what the drop down list user picks, to autofill a field text or automatically fill in the corresponding text.
    for example, lets say,i pick the contractor from the dropdown list, and it will automatically pull the contractors drivers license number. Is this possible? please point to the right directions.

  2. #2
    The short answer to your question is yes. If you store the relevant details in a worksheet, you can use a function to read the worksheet into your combo or list box e.g. see https://www.gmayor.com/Userform_ComboBox.html. Then use the values in the hidden columns to fill a bookmark or better still write to a content control.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    that is exactly what I was looking for, is there a tutorial to do each of those steps? and instead of having the button "signature" could I just add it into a commandbutton_click, I already have bookmarks, and other macros. Thank you.

  4. #4
    The web page provides the function code to read a worksheet into a list/combo box. The following when modified to suit what you have will write the columns from the combo box/list box to content controls by their titles e.g.

    Dim oCC As ContentControl
    For Each oCC In ActiveDocument.ContentControls
        Select Case oCC.TITLE
            Case "Title 1"
                oCC.Range.Text = comboboxname.Column(1)
            Case "Title 2"
                oCC.Range.Text = comboboxname.Column(2)
                'etc
        End Select
    Next oCC
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  5. #5
    I have been working at it and trying to modify things for my needs, where do I change the tab that says "user form test" and below it has signatur button? (where do I change that) ? thank in advance

  6. #6
    please look at email I sent via your website. thank you.

  7. #7
    I have replied
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  8. #8
    where do I change the add-in from the 'tab' (userform test) to something else? The part were is above the signature.

Posting Permissions

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