W
WP
Hi All
I have created a form that fills out a word doc at the proper bookmarks
when the user clicks submit on the form the doc does get filled out properly
but i cant get the click event to send it as an email as well
here is what I have for code in the on click routine
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("UserName").Range.InsertBefore TextBox1
.Bookmarks("requesttype").Range.InsertBefore TextBox2
.Bookmarks("qty").Range.InsertBefore TextBox3
.Bookmarks("purpose").Range.InsertBefore TextBox4
.Bookmarks("describe").Range.InsertBefore TextBox5
.Bookmarks("other").Range.InsertBefore TextBox6
.Bookmarks("busarea").Range.InsertBefore ComboBox1
.Bookmarks("En").Range.InsertBefore CheckBox1
.Bookmarks("fr").Range.InsertBefore CheckBox2
.Bookmarks("subdate").Range.InsertBefore Calendar1
.Bookmarks("datedue").Range.InsertBefore Calendar2
.Bookmarks("evtdate").Range.InsertBefore Calendar3
End With
UserForm1.Hide
End Sub
here is the code i got for the send email from MVP site
Activedocument.HasRoutingSlip = True
With Activedocument.RoutingSlip
.Subject = "New subject goes here"
.AddRecipient "(e-mail address removed)"
.AddRecipient "(e-mail address removed)"
.Delivery = wdAllAtOnce
End With
Activedocument.Route
My question is where do I put this code to make it work. I have tried
several spots and it didnt work
Second...in my form I have a combo box that i would like the user to be able
to choose thier dept. I am not sure how I get the entries into the combo. I
know in access I would make a table with 1 field and populate the field with
all my depts and bind the combo to that table . How do i do this in word?
TIA
WP
I have created a form that fills out a word doc at the proper bookmarks
when the user clicks submit on the form the doc does get filled out properly
but i cant get the click event to send it as an email as well
here is what I have for code in the on click routine
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("UserName").Range.InsertBefore TextBox1
.Bookmarks("requesttype").Range.InsertBefore TextBox2
.Bookmarks("qty").Range.InsertBefore TextBox3
.Bookmarks("purpose").Range.InsertBefore TextBox4
.Bookmarks("describe").Range.InsertBefore TextBox5
.Bookmarks("other").Range.InsertBefore TextBox6
.Bookmarks("busarea").Range.InsertBefore ComboBox1
.Bookmarks("En").Range.InsertBefore CheckBox1
.Bookmarks("fr").Range.InsertBefore CheckBox2
.Bookmarks("subdate").Range.InsertBefore Calendar1
.Bookmarks("datedue").Range.InsertBefore Calendar2
.Bookmarks("evtdate").Range.InsertBefore Calendar3
End With
UserForm1.Hide
End Sub
here is the code i got for the send email from MVP site
Activedocument.HasRoutingSlip = True
With Activedocument.RoutingSlip
.Subject = "New subject goes here"
.AddRecipient "(e-mail address removed)"
.AddRecipient "(e-mail address removed)"
.Delivery = wdAllAtOnce
End With
Activedocument.Route
My question is where do I put this code to make it work. I have tried
several spots and it didnt work
Second...in my form I have a combo box that i would like the user to be able
to choose thier dept. I am not sure how I get the entries into the combo. I
know in access I would make a table with 1 field and populate the field with
all my depts and bind the combo to that table . How do i do this in word?
TIA
WP