![]() |
#6
|
||||
|
||||
![]()
Here is the code to do the non-Greek and non-operator content. I'll leave it to you to do the rest.
Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "[!\<-\>\^÷" & AscW(&H374) & "-" & AscW(&H3E1) & _ AscW(&H2C2) & "-" & AscW(&H2C7) & _ AscW(&H1F00) & "-" & AscW(&H1FEE) & _ AscW(&H2044) & "-" & AscW(&H208E) & _ AscW(&H2202) & "-" & AscW(&H2265) & "]" .Replacement.Text = "" .MatchWildcards = True .Format = True .Forward = True .Wrap = wdFindContinue .Font.Bold = False .Font.Italic = True .Font.Subscript = False .Font.Superscript = False .Replacement.Style = "cItalic" .Execute Replace:=wdReplaceAll .Font.Subscript = True .Font.Superscript = False .Replacement.Style = "cIsub" .Execute Replace:=wdReplaceAll .Font.Subscript = False .Font.Superscript = True .Replacement.Style = "cIsup" .Execute Replace:=wdReplaceAll .Font.Bold = True .Font.Italic = False .Font.Subscript = False .Font.Superscript = False .Replacement.Style = "cBold" .Execute Replace:=wdReplaceAll .Font.Subscript = True .Font.Superscript = False .Replacement.Style = "cBsub" .Execute Replace:=wdReplaceAll .Font.Subscript = False .Font.Superscript = True .Replacement.Style = "cBsup" .Execute Replace:=wdReplaceAll .Font.Bold = True .Font.Italic = True .Font.Subscript = False .Font.Superscript = False .Replacement.Style = "cBI" .Execute Replace:=wdReplaceAll .Font.Subscript = True .Font.Superscript = False .Replacement.Style = "cBIsub" .Execute Replace:=wdReplaceAll .Font.Subscript = False .Font.Superscript = True .Replacement.Style = "cBIsup" .Execute Replace:=wdReplaceAll .Font.Bold = False .Font.Italic = False .Font.Subscript = True .Font.Superscript = False .Replacement.Style = "cSub" .Execute Replace:=wdReplaceAll .Font.Subscript = False .Font.Superscript = True .Replacement.Style = "cSup" .Execute Replace:=wdReplaceAll .ClearFormatting .Font.AllCaps = True .Font.SmallCaps = False .Replacement.Style = "cAllCaps" .Execute Replace:=wdReplaceAll .Font.AllCaps = False .Font.SmallCaps = True .Replacement.Style = "cSmCap" .Execute Replace:=wdReplaceAll End With End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Style type character continues on to new paragraph | myalo | Word | 6 | 02-07-2021 02:56 PM |
Automatically applying character style while using fast style feature | Didier Super | Word | 1 | 04-10-2017 05:10 AM |
![]() |
Jennifer Murphy | Word VBA | 2 | 12-14-2015 02:31 AM |
Change the leading of a character style??? | Char t | Word | 1 | 11-05-2011 01:18 PM |
Character style stripped while applying paragraph style | sams_gates | Word | 0 | 08-29-2009 02:03 AM |