Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
User From Combo box help
I am having some problems with my code. I want to select a choice in my
combobox, enter info into two text box's, then update the bookmarks in a document when the command button is clicked. The text box's are working. However I cannot get the Case "Army" to work. Please review my code and help thanks! Private Sub CommandButton1_Click() Select Case ComboBox1 Case "Army" Bookmarks("Address").Range InsertBefore "Army Base" End Select With ActiveDocument .Bookmarks("Text1").Range _ .InsertBefore TextBox1 .Bookmarks("Text2").Range _ .InsertBefore TextBox2 End With UserForm1.Hide End Sub Private Sub UserForm_Initialize() ComboBox1.AddItem "Army" ComboBox1.AddItem "Navy" ComboBox1.AddItem "Air Force" ComboBox1.AddItem "Marines" ComboBox1.Style = fmStyleDropDownList ComboBox1.BoundColumn = 0 ComboBox1.ListIndex = 0 End Sub |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
User From Combo box help
Asked and answered.
-- Greg Maxey/Word MVP See: http://gregmaxey.mvps.org/word_tips.htm For some helpful tips using Word. Kenny wrote: I am having some problems with my code. I want to select a choice in my combobox, enter info into two text box's, then update the bookmarks in a document when the command button is clicked. The text box's are working. However I cannot get the Case "Army" to work. Please review my code and help thanks! Private Sub CommandButton1_Click() Select Case ComboBox1 Case "Army" Bookmarks("Address").Range InsertBefore "Army Base" End Select With ActiveDocument .Bookmarks("Text1").Range _ .InsertBefore TextBox1 .Bookmarks("Text2").Range _ .InsertBefore TextBox2 End With UserForm1.Hide End Sub Private Sub UserForm_Initialize() ComboBox1.AddItem "Army" ComboBox1.AddItem "Navy" ComboBox1.AddItem "Air Force" ComboBox1.AddItem "Marines" ComboBox1.Style = fmStyleDropDownList ComboBox1.BoundColumn = 0 ComboBox1.ListIndex = 0 End Sub |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Combo Box | Microsoft Word Help | |||
Combo Box | Microsoft Word Help | |||
User Forms and Combo boxes in Work | Microsoft Word Help | |||
Create Protected Word template that uses combo box & combo box val | Microsoft Word Help | |||
combo box | Microsoft Word Help |