Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / May 2005

Tip: Looking for answers? Try searching our database.

Macro to replace 580 off them.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steved - 31 May 2005 08:10 GMT
Hello from Steved

T(  9  0  4) S( 1 0 0) C( 0 0 0) D( 3 0 2) J( 6 0 2)

.Text = "[A-Z]\([0-9 ]{1,}\)" works fine but I would like to
Bold and increase the Font to 10 What do I need to do please,
with my attempt below to work Thankyou.

Sub DeleteT()
   Selection.Find.ClearFormatting
   Selection.Find.Replacement.ClearFormatting
   With Selection.Find
       .Text = "[A-Z]\([0-9 ]{1,}\)"
       .Replacement.Text = ""
       .Forward = True
       .Wrap = wdFindContinue
       .Format = True
       .MatchCase = False
       .MatchWholeWord = False
       .MatchAllWordForms = False
       .MatchSoundsLike = False
       .MatchWildcards = True
   End With
      With Selection.Find.Font
       .Size = 10
       .Bold = True
   Selection.Find.Execute Replace:=wdReplaceAll
   End With
End Sub
Doug Robbins - 31 May 2005 09:06 GMT
Try

Dim myrange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
   Do While .Execute(FindText:="[A-Z]\([0-9 ]{1,}\) ",
MatchWildcards:=True, _
Wrap:=wdFindStop, Forward:=True) = True
       Set myrange = Selection.Range
       myrange.Font.Size = 10
       myrange.Font.Bold = True
   Loop
End With

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hello from Steved
>
[quoted text clipped - 25 lines]
>    End With
> End Sub
Steved - 31 May 2005 10:14 GMT
Thankyou.

> Try
>
[quoted text clipped - 40 lines]
> >    End With
> > End Sub
Graham Mayor - 31 May 2005 09:14 GMT
Try

Sub DeleteT()
   Selection.Find.ClearFormatting
   Selection.Find.Replacement.ClearFormatting
   With Selection.Find
       .Text = "[A-Z]\([0-9 ]{1,}\)"
       .Replacement.Text = ""
       .Forward = True
       .Wrap = wdFindContinue
       .Format = True
       .MatchCase = False
       .MatchWholeWord = False
       .MatchAllWordForms = False
       .MatchSoundsLike = False
       .MatchWildcards = True
       .Replacement.Text = ""
       .Replacement.Font.Size = "10"
       .Replacement.Font.Bold = True
   Selection.Find.Execute replace:=wdReplaceAll
   End With
End Sub

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Hello from Steved
>
[quoted text clipped - 25 lines]
>     End With
> End Sub
Steved - 31 May 2005 10:15 GMT
Thankyou

> Try
>
[quoted text clipped - 48 lines]
> >     End With
> > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.