2013-12-16, 16:25 #1
- Join Date
- Aug 2010
- Thanked 0 Times in 0 Posts
How to display first item in a Word 2010 drop-down box
OK....I have a WORD 2010 document with various DropDown boxes. On the "Document_Open()" sub-routine I need to fill certain DropDown boxes with items from a file. No problem with that. The issue I have is the DropDown box is in fact filled with the items from the file, but on the document the DropDown box field is blank. It only shows the entries when you click on the DropDown box.
I can't figure out how in the Open_Document() sub routine to force the DropDown box to display the first item, so the field is not blank on the document.
Any help would be appreciated. Thanks. Bob
Subscribe to our Windows Secrets Newsletter - It's Free!
Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!
+ Get this BONUS — free!
Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!
2013-12-16, 16:49 #2
- Join Date
- Jan 2001
- Melbourne, Victoria, Australia
- Thanked 143 Times in 136 Posts
Is this drop down box a Content Control? If so, the following might give you a clue
Sub aa() With ActiveDocument.ContentControls(1) .DropdownListEntries.Clear .DropdownListEntries.Add "hello mum" .DropdownListEntries.Add "hi dad" .Range = .DropdownListEntries.Item(1) End With End Sub
Me.ListBox1.ListIndex = 1
although the first entry may be 0 because that list may be zero-based.Andrew Lockton, Chrysalis Design, Melbourne Australia