Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 05-14-2021, 11:53 PM
macropod's Avatar
macropod macropod is offline character style Windows 10 character style Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
 



Similar Threads
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
character style Tab character causes style change to Heading 4 after macro 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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft