![]() |
#11
|
|||
|
|||
![]()
Do the content controls preserve their name as you combine documents? Or do they continue to add number?
I have decided to go back to the search method. I will be allowing users to use some older forms that have the same content but are formatted differently. The find method allows them to do this. The below code works, but is not looping though each table in my document. I know this is basic VBA... but I am unable to get this to loop the whole document. Code:
Selection.Find.ClearFormatting With Selection.Find .Text = "Catagory 1" .Replacement.Text = "" .Forward = True .Wrap = wdFindStop End With Selection.Find.Execute Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell vCatagory1 = Selection.Text Selection.Collapse Selection.Find.ClearFormatting With Selection.Find .Text = "Catagory 2:" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue End With Selection.Find.Execute Selection.MoveRight Unit:=wdCell vCatagory2 = Selection.Text Selection.Collapse Selection.Find.ClearFormatting With Selection.Find .Text = "Catagory 3" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue End With Selection.Find.Execute Selection.MoveRight Unit:=wdCell vCatagory3 = Selection.Text Selection.MoveRight Unit:=wdCell ActiveDocument.Indexes.MarkEntry Range:=Selection.Range, _ Entry:=vCatagory1 & ":" & vCatagory2 & ":" & vCatagory3, CrossReference:="", CrossReferenceAutoText:="", _ BookmarkName:="", Bold:=False, Italic:=False Last edited by cksm4; 01-13-2011 at 07:58 PM. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Textbox updating from combobox selection | paxile2k | Word VBA | 0 | 10-26-2010 02:30 PM |
Document selection procedure | kennethc | Word | 0 | 09-15-2010 02:56 PM |
The modification is not allowed because selection is locked | aligahk06 | Word | 0 | 09-06-2010 06:28 AM |
Automatic find replace after selection in dropdown | vsempoux | Word | 0 | 10-28-2009 08:45 AM |
Highlighted Selection on Action Settings | mos7sad | PowerPoint | 0 | 10-12-2009 07:48 AM |