Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Book Marks VB Add Line Returns? | Microsoft Word Help | |||
Page Numbering A Book That Contains Multiple Sections. | Page Layout | |||
Book marks | Formatting Long Documents | |||
creating a master index page for multiple chapters of a book | Microsoft Word Help | |||
how to create a master index page for multiple chapters of a book | Microsoft Word Help |