Thread: [Solved] Continuous Loop
View Single Post
 
Old 01-06-2011, 07:32 PM
cksm4 cksm4 is offline Windows XP Office 2007
Advanced Beginner
 
Join Date: Aug 2010
Posts: 48
cksm4 is on a distinguished road
Default

Hey Paul,

Thanks for the reply. I am trying to hide part of a table. I have the user insert quick parts as they input new activities. Each quick part adds new rows to the table. These are then compiled into a report. Some activities later become "irrelevant" to the final report and I want the user to be able to hide these prior to printing.

To complicate it, I am using rich text controls to capture the data. I removed one of these activity tables, placed it on its own, removed all the paragraph marks in the table, and placed a paragraph mark before and after the table. I also placed one of my rich text controls with the target wording on its own as a secondary test. Using the following code the table and individual rich text control did not hide:

Selection.Find.ClearFormatting
With Selection.Find
.Text = "[!^13]{1,}DO NOT PUBLISH ACTIVITY[!^13]{1,}[^13]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
While Selection.Find.Execute
Selection.Font.Hidden = True
Wend


I may be WAY off as I am new to VBA/macros. Am I using this code wrong? Or perhaps does it not work on tables and rich text controls???

Again, much appreciation for you help!!!

Brock
Reply With Quote