Reply
 
Thread Tools Display Modes
  #1   Report Post  
Steved
 
Posts: n/a
Default find T( then highlight to the end of Row

Hello from Steved

How do I please

Find, T( then highlight to the end of Row then bold it.

Thankyou
  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default

On Sat, 17 Sep 2005 19:41:02 -0700, Steved
wrote:

Hello from Steved

How do I please

Find, T( then highlight to the end of Row then bold it.

Thankyou


Use a wildcard search/replace -- see
http://www.gmayor.com/replace_using_wildcards.htm.

First be clear about what you're asking for: when you say "row", do
you mean a line (without a paragraph mark at the end), a paragraph
(with a paragraph mark at the end, visible as ¶ when you click the
Show All button), or a table row? The entries you make in the Replace
dialog are different...

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
  #3   Report Post  
Steved
 
Posts: n/a
Default

Hello Jay from Steved

I simply meant end of Line. You posed a good question I have to go away and
think about it

Thankyou.

"Jay Freedman" wrote:

On Sat, 17 Sep 2005 19:41:02 -0700, Steved
wrote:

Hello from Steved

How do I please

Find, T( then highlight to the end of Row then bold it.

Thankyou


Use a wildcard search/replace -- see
http://www.gmayor.com/replace_using_wildcards.htm.

First be clear about what you're asking for: when you say "row", do
you mean a line (without a paragraph mark at the end), a paragraph
(with a paragraph mark at the end, visible as ¶ when you click the
Show All button), or a table row? The entries you make in the Replace
dialog are different...

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

  #4   Report Post  
Steved
 
Posts: n/a
Default

Hell from Steved

Below is my code Just need it to be modified to do the whole document please.

Sub Tc()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "T("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Bold = wdToggle
End Sub


"Steved" wrote:

Hello Jay from Steved

I simply meant end of Line. You posed a good question I have to go away and
think about it

Thankyou.

"Jay Freedman" wrote:

On Sat, 17 Sep 2005 19:41:02 -0700, Steved
wrote:

Hello from Steved

How do I please

Find, T( then highlight to the end of Row then bold it.

Thankyou


Use a wildcard search/replace -- see
http://www.gmayor.com/replace_using_wildcards.htm.

First be clear about what you're asking for: when you say "row", do
you mean a line (without a paragraph mark at the end), a paragraph
(with a paragraph mark at the end, visible as ¶ when you click the
Show All button), or a table row? The entries you make in the Replace
dialog are different...

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

  #5   Report Post  
Jay Freedman
 
Posts: n/a
Default

Hi Steved,

Replace your macro with this one (notes below):

Sub Tc()
Selection.HomeKey wdStory
With Selection.Find
.Text = "T("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False

Do While .Execute
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Bold = True
Selection.Collapse wdCollapseEnd
Loop
End With
End Sub

The changes:

- Start by moving the Selection to the start of the document
(.HomeKey) and change the .Wrap to wdFindStop. The effect of this is
that the search will run all the way through the document once,
instead of looping around from the end back to the beginning.

- Replace the single .Execute statement with the Do While ... Loop to
repeat the search until no more hits appear. The way this works is
that the .Execute method returns a True value when it finds the .Text,
but returns False (thus stopping the loop) when it fails to find it.

- Add the .Collapse call. This collapses the Selection to an insertion
point at the end of its current location, so the next search starts
there rather than at the beginning of the current selection (in which
it would find the hit that it just finished processing).

- Change the .Bold = wdToggle to .Bold = True -- I assume you want it
to be bold even if it was already bold, while wdToggle would change
bold to not-bold.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

On Sat, 17 Sep 2005 20:45:02 -0700, Steved
wrote:

Hell from Steved

Below is my code Just need it to be modified to do the whole document please.

Sub Tc()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "T("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Bold = wdToggle
End Sub


"Steved" wrote:

Hello Jay from Steved

I simply meant end of Line. You posed a good question I have to go away and
think about it

Thankyou.

"Jay Freedman" wrote:

On Sat, 17 Sep 2005 19:41:02 -0700, Steved
wrote:

Hello from Steved

How do I please

Find, T( then highlight to the end of Row then bold it.

Thankyou

Use a wildcard search/replace -- see
http://www.gmayor.com/replace_using_wildcards.htm.

First be clear about what you're asking for: when you say "row", do
you mean a line (without a paragraph mark at the end), a paragraph
(with a paragraph mark at the end, visible as ¶ when you click the
Show All button), or a table row? The entries you make in the Replace
dialog are different...

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org



  #6   Report Post  
Steved
 
Posts: n/a
Default

Hello Jay from Steved

Thankyou very much.

"Jay Freedman" wrote:

Hi Steved,

Replace your macro with this one (notes below):

Sub Tc()
Selection.HomeKey wdStory
With Selection.Find
.Text = "T("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False

Do While .Execute
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Bold = True
Selection.Collapse wdCollapseEnd
Loop
End With
End Sub

The changes:

- Start by moving the Selection to the start of the document
(.HomeKey) and change the .Wrap to wdFindStop. The effect of this is
that the search will run all the way through the document once,
instead of looping around from the end back to the beginning.

- Replace the single .Execute statement with the Do While ... Loop to
repeat the search until no more hits appear. The way this works is
that the .Execute method returns a True value when it finds the .Text,
but returns False (thus stopping the loop) when it fails to find it.

- Add the .Collapse call. This collapses the Selection to an insertion
point at the end of its current location, so the next search starts
there rather than at the beginning of the current selection (in which
it would find the hit that it just finished processing).

- Change the .Bold = wdToggle to .Bold = True -- I assume you want it
to be bold even if it was already bold, while wdToggle would change
bold to not-bold.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

On Sat, 17 Sep 2005 20:45:02 -0700, Steved
wrote:

Hell from Steved

Below is my code Just need it to be modified to do the whole document please.

Sub Tc()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "T("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Bold = wdToggle
End Sub


"Steved" wrote:

Hello Jay from Steved

I simply meant end of Line. You posed a good question I have to go away and
think about it

Thankyou.

"Jay Freedman" wrote:

On Sat, 17 Sep 2005 19:41:02 -0700, Steved
wrote:

Hello from Steved

How do I please

Find, T( then highlight to the end of Row then bold it.

Thankyou

Use a wildcard search/replace -- see
http://www.gmayor.com/replace_using_wildcards.htm.

First be clear about what you're asking for: when you say "row", do
you mean a line (without a paragraph mark at the end), a paragraph
(with a paragraph mark at the end, visible as ¶ when you click the
Show All button), or a table row? The entries you make in the Replace
dialog are different...

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find Encarta syllable mark [email protected] New Users 0 August 17th 05 05:20 PM
Finding higlights with a specific color Peter New Users 4 August 5th 05 11:26 PM
Find & Replace does not find formatting Ed Microsoft Word Help 5 April 1st 05 12:33 AM
Gettign find to highlight in middle of page Roland Microsoft Word Help 1 March 17th 05 12:12 PM
Find and Replace anomaly BruceM Microsoft Word Help 7 January 18th 05 05:47 PM


All times are GMT +1. The time now is 09:21 PM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"