#1   Report Post  
Posted to microsoft.public.word.docmanagement
Kenny Kenny is offline
external usenet poster
 
Posts: 23
Default Multiple Book Marks???

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
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Multiple Book Marks???

Use a bookmark for the first occurrence, and use REF fields for the
rest. See http://gregmaxey.mvps.org/Repeating_Data.htm.

On Sat, 22 Sep 2007 10:48:01 -0700, Kenny
wrote:

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


--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 285
Default Multiple Book Marks???

Asked and answered in you repeated post later today.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


Kenny wrote:
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



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Book Marks VB Add Line Returns? Kenny Microsoft Word Help 1 September 22nd 07 05:55 PM
Page Numbering A Book That Contains Multiple Sections. Unsuccessful Download Page Layout 1 April 17th 07 04:27 AM
Book marks Richard Formatting Long Documents 8 January 7th 07 07:39 PM
creating a master index page for multiple chapters of a book Kay Microsoft Word Help 3 October 26th 05 03:00 PM
how to create a master index page for multiple chapters of a book Kay Microsoft Word Help 1 October 25th 05 03:25 PM


All times are GMT +1. The time now is 01:55 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"