Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-31-2021, 09:33 PM
stky stky is offline highlight replacement format where is mistake Windows 10 highlight replacement format where is mistake Office 2013
Advanced Beginner
highlight replacement format where is mistake
 
Join Date: Apr 2021
Posts: 30
stky is on a distinguished road
Default highlight replacement format where is mistake

Sub boltitalic()

Dim objDoc As Document
Dim cboltitalic As Style
Set objDoc = ActiveDocument

Set cboltitalic = ActiveDocument.Styles.Add("*boltitalic", Type:=WdStyleType.wdStyleTypeCharacter)
Options.DefaultHighlightColorIndex = wdYellow
Selection.Find.ClearFormatting
With cboltitalic.Font
.Name = "Times New Roman"
.Bold = True
.Italic = True
.Subscript = False
.Superscript = False

End With

Dim rngStory As Range
For Each rngStory In ActiveDocument.StoryRanges

Application.ScreenUpdating = False
With ActiveDocument.Range
With rngStory.Find

.ClearFormatting
.Replacement.ClearFormatting
.text = "[!+\-\<\>]"
.Replacement.text = ""
.MatchWildcards = True
.Format = True
.Forward = True


.Wrap = wdFindContinue

.Font.Bold = True
.Font.Italic = True
.Font.Subscript = False
.Font.Superscript = False
.Replacement.Style = "*boltitalic"
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Highlight = True
.Execute Replace:=wdReplaceAll


End With
End With
Next rngStory
Application.ScreenUpdating = True
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
I've set up sync with iCloud by mistake brissle Outlook 0 12-13-2014 01:02 PM
Huge Mistake! markg2 Excel 2 05-12-2014 08:05 AM
Made a mistake with a macro change lance_kidd Word 0 02-09-2011 06:36 PM
highlight replacement format where is mistake Initial Mistake simpson55 Outlook 2 02-02-2011 09:52 AM
find - reading highlight - highlight all / highlight doesn't stick when saved bobk544 Word 3 04-15-2009 03:31 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:51 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