Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 07-06-2022, 05:50 AM
JTell JTell is offline Create Word macro to delete text throughout the entire document Windows 10 Create Word macro to delete text throughout the entire document Office 2016
Novice
Create Word macro to delete text throughout the entire document
 
Join Date: Jul 2022
Posts: 5
JTell is on a distinguished road
Default

That works perfectly - thank you!
Is there any chance you can explain how that works? I have another macro that I need to loop through as well... it will find blue text with an underline, remove the formatting, cut it, turn on change tracking, paste it back in, then turn off change tracking. I've tried to mimic what you had, but it doesn't seem to work...

Code that works (without the loop):
Sub ChangeTrackBlueFont()
'
' ChangeTrackBlueFont Macro
'
'
Selection.Find.ClearFormatting
With Selection.Find.Font
.Underline = wdUnderlineSingle
.Color = wdColorBlue
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Font.UnderlineColor = wdColorAutomatic
Selection.Font.Underline = wdUnderlineNone
Selection.Cut
ActiveDocument.TrackRevisions = Not ActiveDocument.TrackRevisions
Selection.PasteAndFormat (wdFormatOriginalFormatting)
ActiveDocument.TrackRevisions = Not ActiveDocument.TrackRevisions
End Sub
Reply With Quote
 

Tags
loop, macro



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Word macro to delete text throughout the entire document Macro to search for a particular word, copy the entire paragraph to a new document Productivity Word VBA 2 10-25-2019 06:40 AM
Create Word macro to delete text throughout the entire document Delete entire paragraph after key word jeffreybrown Word 2 07-27-2018 02:29 PM
Create Word macro to delete text throughout the entire document Need Word Macro to Delete Text rsrasc Word VBA 4 04-18-2018 11:32 PM
Microsoft Word macro to find text, select all text between brackets, and delete helal1990 Word VBA 4 02-05-2015 03:52 PM
Create Word macro to delete text throughout the entire document Macro to create new word doc and save the file using String found in the document VBNation Word VBA 2 02-08-2013 07:14 AM

Other Forums: Access Forums

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