PinkeyNBrain
IS-IT--Management
Start with a MSWord template similar to:
I select a range (say range_1) modifying text as current needs dictate (eg. today_bla bla bla) I then go back over the range and look for chunks of text I don't need (eg. unused_text), and want to delete the entire line. Here is my existing sub to work with this.
What is happening is that I only want to work within the current range. The sub as written does not confine itself to curr_section_rng and keeps going into the remainder of the document. How do I keep the activity limited to curr_section_rng
BTW - This question is a follow-up to posting "Preserving select.find" a few days eariler.
word.docm said:range_1
today_bla bla bla
unused_text
today_bla bla bla
range_2
may_or_maynot_be_used_bla bla bla
may_or_maynot_be_used_bla bla bla
may_or_maynot_be_used_bla bla bla
may_or_maynot_be_used_bla bla bla
range_3
may_or_maynot_be_used_bla bla bla
may_or_maynot_be_used_bla bla bla
range_eof
I select a range (say range_1) modifying text as current needs dictate (eg. today_bla bla bla) I then go back over the range and look for chunks of text I don't need (eg. unused_text), and want to delete the entire line. Here is my existing sub to work with this.
Code:
Dim curr_section_rng As Range
call_a_sub_that_selects_my_range
Set curr_section_rng = Selection.Range
With curr_section_rng.Find
.Text = "unused_text"
.Wrap = wdFindStop
End With
Do While curr_section_rng.Find.Execute
sel_text = curr_section_rng.Text
call_another_sub sel_text
Loop
What is happening is that I only want to work within the current range. The sub as written does not confine itself to curr_section_rng and keeps going into the remainder of the document. How do I keep the activity limited to curr_section_rng
BTW - This question is a follow-up to posting "Preserving select.find" a few days eariler.