View Single Post
 
Old 02-15-2014, 06:22 PM
hwg hwg is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Feb 2014
Posts: 8
hwg is on a distinguished road
Default

Also, I did try this using styles but couldn't get it to work. I must not have the right syntax to detect and replace on styles instead of fonts.

I tried something like this:

Code:
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
  With oRng.Find
    .Text = " in "
    .ClearFormatting
    .Style.Name = "<my style name here>"
    .Font.Size = 8
    .Replacement.ClearFormatting
    .Replacement.Style.Name = "<my replacement style name here>"
    .Execute Replace:=wdReplaceAll
  End With
It gave me the error "Object Required" on the line .Style.Name = "... "
Reply With Quote