Multiple Book Marks???

K

Kenny

Okay maybe I went about this the wrong way. I am creating a letter using a
user form. Once user form is filled, press command button, fills form.
Problem is that I need to place the same book mark in multiple spots in the
document. When I place a bookmark with the same name as one I already have in
the document it erases the other.

1. How do I fix this using bookmarks?
2. Should I be using some kind of control in the word doc instead of
bookmarks to make this application work better? If so please provide code I
am very new.

Using MS Office 2003, Please Help, Here is my code.

Private Sub CommandButton1_Click()
Select Case ComboBox1.Text
Case "Army"
ActiveDocument.Bookmarks("Locator").Range.Text = "HRC - Indianapolis" _
& vbCr & "ATTN:AHRC-ERP" & vbCr & "8899 East 56th Street" _
& vbCr & "Indianapolis, IN 46249-5301"
Case "Navy"
ActiveDocument.Bookmarks("Locator").Range.Text = "World Wide Locator" _
& vbCr & "Bureau of Naval Personnel" & vbCr & "PERS 312F" _
& vbCr & "5720 Integrity Drive" & vbCr & "Millington, TN 38055-3120"
Case "Air Force"
ActiveDocument.Bookmarks("Locator").Range.Text = "HQ AFPC/DPDXIDL" _
& vbCr & "550 C. Street West, Suite 50" & vbCr & "Randolph AFB, TX
78150-4752"
Case "Marines"
ActiveDocument.Bookmarks("Locator").Range.Text = "Headquarters USMC" _
& vbCr & "Personnel Management Support Branch (MMSB-17)" _
& vbCr & "2008 Elliot Road" & vbCr & "Quantico, VA 22134-5030"
End Select
With ActiveDocument
.Bookmarks("CustomersName").Range _
.InsertBefore TextBox1
.Bookmarks("AccountNumber").Range _
.InsertBefore TextBox2
.Bookmarks("SocialNumber").Range _
.InsertBefore TextBox3
.Bookmarks("CSRName").Range _
.InsertBefore TextBox4
.Bookmarks("CSRPhone").Range _
.InsertBefore TextBox5
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top