![]() |
#1
|
|||
|
|||
![]() Hello All! Somewhat new to the VBA aspect of Word, so please be gentle. I have searched the forum and results have only shown me how to do this in reverse. So far, this form is simple and have not had to use any scripts. here goes... I have a Word Macro-Enabled Document and I am creating a form for internal use. I have added five plain text content controls where users will enter their desired names for specific devices. On a different page, I wish to have a drop down(or combo box) that lists those five entries as choices. Basically, they are entering those 5 names and then choosing which one they want as their default later on in the form. Is this possible? |
#2
|
|||
|
|||
![]()
Hi
If it is feasible it would be far easier to use Excel as this would be very simple to do. Is there an option to use Excel for your needs? Tony |
#3
|
|||
|
|||
![]()
I could certainly do that if it is necessary. what is your idea?
thanks for the reply |
#4
|
|||
|
|||
![]()
Hi
See attached spreadsheet. Column A - Enter your choices in each of the five cells. Cell D2 - Click on the drop down list and click on your choice. Good luck Tony |
#5
|
|||
|
|||
![]()
That will certainly work...thank you. I'm still curious if it will work in Word but will research later.
thanks again |
#6
|
|||
|
|||
![]()
Hi
See this example in a word document. Instructions on its use are contained in the Word document. Good luck. Tony |
#7
|
||||
|
||||
![]()
Try the attached. Simply update the text content controls, then select the dropdown content control.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
![]()
Thank you all for the replies! I will try these over the next couple of days and post results.
![]() |
#9
|
|||
|
|||
![]()
Hi
I would recommend you go with Paul's solution as it is more efficient. Good luck. Tony |
#10
|
|||
|
|||
![]() Quote:
I will be using the other to use in Excel forms that I already have Thanks again All |
#11
|
||||
|
||||
![]() Quote:
For example, if you want to add another set to populate a different dropdown content control with the contents of another set of text content controls, it's quite easy to replicate the If ... End If block and change the content control titles to suit whatever you use for the parallel set.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#12
|
|||
|
|||
![]() Quote:
unfortunately I am not very competent with vba. I tried to just copy/paste the code and change the titles(in bold from your code below) I am not sure what the lines below it are doing... I am trying to get some help internally but not much experience there either. I am not clear on what the lines in red are doing(which is most of the code) ![]() If ContentControl.Title = "Period" Then ContentControl.DropdownListEntries.Clear For i = 1 To .ContentControls.Count If Left(.ContentControls(i).Title, 4) = "Time" Then j = j + 1 ContentControl.DropdownListEntries.Add Text:=j & " - " & .ContentControls(i).Range.Text |
#13
|
||||
|
||||
![]()
Hi ReviTULize,
The 'lines below' are reading the other content controls to get their contents for populating the dropdown entries. If you explain what you're trying to accomplish, perhaps I could advise on how to go about it.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#14
|
|||
|
|||
![]()
The sample that you sent worked perfectly & again, thank you. Now, elsewhere in the document, I would like to add a second drop down that works the same way, but has no reference to the other(s).
Does that help? |
#15
|
||||
|
||||
![]()
Here's a demo with two independent dropdowns, each sourced by its own series of text content controls. As you'll see when you examine the code and the content control titles, adding an extra series is quite easy.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Caption Text Entry Disabled?!? | MYGS | Word | 14 | 06-21-2016 07:07 PM |
![]() |
David C | Word | 1 | 10-24-2012 04:53 AM |
![]() |
Skep18 | Word | 2 | 05-29-2012 10:52 AM |
![]() |
jegarner | Word | 4 | 05-15-2011 04:17 PM |
Text Entry affecting text below it | mwalker2 | Word | 2 | 03-20-2011 11:37 AM |