Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 01-13-2011, 05:30 PM
cksm4 cksm4 is offline Save Selection Windows XP Save Selection Office 2007
Advanced Beginner
Save Selection
 
Join Date: Aug 2010
Posts: 48
cksm4 is on a distinguished road
Default

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.
Reply With Quote
 



Similar Threads
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

Other Forums: Access Forums

All times are GMT -7. The time now is 08:16 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft