|
|
|
date: Tue, 9 Sep 2008 16:35:48 -0700 (PDT),
group: microsoft.public.word.vba.beginners
back
Re: Macro to format text between square brackets and text with in braces
Sub ScratchMacro()
Dim oRng As Range
Set oRng = ActiveDocument.Content
With oRng.Find
.ClearFormatting
.Text = "\[*\]"
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
Do While .Execute
With oRng
.MoveEnd unit:=wdCharacter, Count:=-1
.MoveStart unit:=wdCharacter, Count:=1
.Font.Color = wdColorBlue
.Font.Bold = True
.Font.Size = "14"
.Collapse wdCollapseEnd
End With
Loop
End With
Set oRng = ActiveDocument.Content
With oRng.Find
.ClearFormatting
.Text = "\{*\}"
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
Do While .Execute
With oRng
.MoveEnd unit:=wdCharacter, Count:=-1
.MoveStart unit:=wdCharacter, Count:=1
.Font.Color = wdColorRed
.Font.Italic = True
.Font.Size = "10"
.Collapse wdCollapseEnd
End With
Loop
End With
End Sub
--
Greg Maxey - Word MVP
My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org
"jb" wrote in message
news:44069e8a-c22d-4f5d-b40b-4d7b5599b4d5@f63g2000hsf.googlegroups.com...
> Hello,
>
> I am a word macro neophyte at best.
>
> What I would like is a macro that would:
> bold, font size =14, font color = blue all text between square
> brackets [ ] and put all text between braces, { } to font size 10,
> italics, color=red. Any direction would be appreciated. Thank-you.
>
> JB
date: Tue, 9 Sep 2008 19:59:03 -0400
author: Greg Maxey RrOMEOgOLF
|
|