S
Shauna Koppang
Word 2000. If anyone know of a good place to look for this
kind of basic coding please let me know. I am a rank
beginner!
I have a templates in which I am trying to create a user
form that contains a couple of list boxes (could do combo
boxes) where the users would select an item in the list
and it would insert the results into a bookmarked area.
Have created the 2 Bookmarks on a single space (Text1 &
Text2), create a UserForm with 2 List Boxes and 1 Command
Button only on the form. Firstly, I can't figure out
where to enter the values that are to appear in a list box
and secondly, how to have it enter into the bookmark
position.
OK I have been able to use the ListBox1.AddItem to add
the items to the list when the command button is clicked
but it needs to be there to begin with, and then on the
click it needs to be placed at the bookmarks.
Coding for a straight text box I got working was:
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("Text1").Range.InsertBefore TextBox1
'Check - if no contents give message
Sub ExitText1()
With ActiveDocument.FormFields("Text1")
If Len(.Result) = 0 Then
MsgBox "You must fill in this field"
End If
End With
End Sub
Sub GoBacktoText1()
ActiveDocument.Bookmarks("Text1").InsertBefore TextBox1
End Sub
.Bookmarks("Text2").Range.InsertBefore TextBox2
End With
UserForm1.Hide
End Sub
Your assistance would truly help. Thanks!!!
Shauna
kind of basic coding please let me know. I am a rank
beginner!
I have a templates in which I am trying to create a user
form that contains a couple of list boxes (could do combo
boxes) where the users would select an item in the list
and it would insert the results into a bookmarked area.
Have created the 2 Bookmarks on a single space (Text1 &
Text2), create a UserForm with 2 List Boxes and 1 Command
Button only on the form. Firstly, I can't figure out
where to enter the values that are to appear in a list box
and secondly, how to have it enter into the bookmark
position.
OK I have been able to use the ListBox1.AddItem to add
the items to the list when the command button is clicked
but it needs to be there to begin with, and then on the
click it needs to be placed at the bookmarks.
Coding for a straight text box I got working was:
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("Text1").Range.InsertBefore TextBox1
'Check - if no contents give message
Sub ExitText1()
With ActiveDocument.FormFields("Text1")
If Len(.Result) = 0 Then
MsgBox "You must fill in this field"
End If
End With
End Sub
Sub GoBacktoText1()
ActiveDocument.Bookmarks("Text1").InsertBefore TextBox1
End Sub
.Bookmarks("Text2").Range.InsertBefore TextBox2
End With
UserForm1.Hide
End Sub
Your assistance would truly help. Thanks!!!
Shauna