Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-01-2013, 02:27 PM
ReviTULize ReviTULize is offline Drop-down Populated with text entry Windows 7 64bit Drop-down Populated with text entry Office 2007
Novice
Drop-down Populated with text entry
 
Join Date: Dec 2011
Posts: 20
ReviTULize is on a distinguished road
Default Drop-down Populated with text entry

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?
Reply With Quote
  #2  
Old 02-05-2013, 05:44 AM
OTPM OTPM is offline Drop-down Populated with text entry Windows 7 32bit Drop-down Populated with text entry Office 2010 32bit
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

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
Reply With Quote
  #3  
Old 02-05-2013, 10:44 AM
ReviTULize ReviTULize is offline Drop-down Populated with text entry Windows 7 64bit Drop-down Populated with text entry Office 2007
Novice
Drop-down Populated with text entry
 
Join Date: Dec 2011
Posts: 20
ReviTULize is on a distinguished road
Default

I could certainly do that if it is necessary. what is your idea?
thanks for the reply
Reply With Quote
  #4  
Old 02-05-2013, 12:29 PM
OTPM OTPM is offline Drop-down Populated with text entry Windows 7 32bit Drop-down Populated with text entry Office 2010 32bit
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

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
Attached Files
File Type: xlsx Book1.xlsx (9.6 KB, 13 views)
Reply With Quote
  #5  
Old 02-05-2013, 12:49 PM
ReviTULize ReviTULize is offline Drop-down Populated with text entry Windows 7 64bit Drop-down Populated with text entry Office 2007
Novice
Drop-down Populated with text entry
 
Join Date: Dec 2011
Posts: 20
ReviTULize is on a distinguished road
Default

That will certainly work...thank you. I'm still curious if it will work in Word but will research later.

thanks again
Reply With Quote
  #6  
Old 02-05-2013, 01:51 PM
OTPM OTPM is offline Drop-down Populated with text entry Windows 7 32bit Drop-down Populated with text entry Office 2010 32bit
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi
See this example in a word document. Instructions on its use are contained in the Word document.
Good luck.
Tony
Reply With Quote
  #7  
Old 02-05-2013, 08:02 PM
macropod's Avatar
macropod macropod is offline Drop-down Populated with text entry Windows 7 64bit Drop-down Populated with text entry Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try the attached. Simply update the text content controls, then select the dropdown content control.
Attached Files
File Type: zip CCtrl DropDown Populate.zip (32.1 KB, 32 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 02-06-2013, 09:08 AM
ReviTULize ReviTULize is offline Drop-down Populated with text entry Windows 7 64bit Drop-down Populated with text entry Office 2007
Novice
Drop-down Populated with text entry
 
Join Date: Dec 2011
Posts: 20
ReviTULize is on a distinguished road
Default

Thank you all for the replies! I will try these over the next couple of days and post results.
Reply With Quote
  #9  
Old 02-06-2013, 12:12 PM
OTPM OTPM is offline Drop-down Populated with text entry Windows 7 32bit Drop-down Populated with text entry Office 2010 32bit
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi
I would recommend you go with Paul's solution as it is more efficient.
Good luck.
Tony
Reply With Quote
  #10  
Old 02-06-2013, 12:28 PM
ReviTULize ReviTULize is offline Drop-down Populated with text entry Windows 7 64bit Drop-down Populated with text entry Office 2007
Novice
Drop-down Populated with text entry
 
Join Date: Dec 2011
Posts: 20
ReviTULize is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Try the attached. Simply update the text content controls, then select the dropdown content control.
This is exactly what I was looking for to use in Word. I cannot figure out how to modify the code to have multiples of these. Is that easy?

I will be using the other to use in Excel forms that I already have

Thanks again All
Reply With Quote
  #11  
Old 02-06-2013, 02:38 PM
macropod's Avatar
macropod macropod is offline Drop-down Populated with text entry Windows 7 64bit Drop-down Populated with text entry Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by ReviTULize View Post
I cannot figure out how to modify the code to have multiples of these. Is that easy?
That depends on what you want to do - and how comptetent you are using content controls and vba.

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]
Reply With Quote
  #12  
Old 02-20-2013, 01:34 PM
ReviTULize ReviTULize is offline Drop-down Populated with text entry Windows 7 64bit Drop-down Populated with text entry Office 2007
Novice
Drop-down Populated with text entry
 
Join Date: Dec 2011
Posts: 20
ReviTULize is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
That depends on what you want to do - and how comptetent you are using content controls and vba.

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.
Thanks for the reply...
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
Reply With Quote
  #13  
Old 02-20-2013, 03:44 PM
macropod's Avatar
macropod macropod is offline Drop-down Populated with text entry Windows 7 64bit Drop-down Populated with text entry Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #14  
Old 02-21-2013, 10:07 AM
ReviTULize ReviTULize is offline Drop-down Populated with text entry Windows 7 64bit Drop-down Populated with text entry Office 2007
Novice
Drop-down Populated with text entry
 
Join Date: Dec 2011
Posts: 20
ReviTULize is on a distinguished road
Default

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?
Reply With Quote
  #15  
Old 02-21-2013, 07:06 PM
macropod's Avatar
macropod macropod is offline Drop-down Populated with text entry Windows 7 64bit Drop-down Populated with text entry Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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.
Attached Files
File Type: zip CCtrl DropDown Populate.zip (33.1 KB, 25 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Caption Text Entry Disabled?!? MYGS Word 14 06-21-2016 07:07 PM
Drop-down Populated with text entry Form field selection allows entry into form text box David C Word 1 10-24-2012 04:53 AM
Drop-down Populated with text entry Request: Creating an Auto-Populated Template Skep18 Word 2 05-29-2012 10:52 AM
Drop-down Populated with text entry Automate text entry in Word 2007 jegarner Word 4 05-15-2011 04:17 PM
Text Entry affecting text below it mwalker2 Word 2 03-20-2011 11:37 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft