Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-22-2019, 05:46 AM
melp melp is offline Macro to delete text in specific styles Windows 10 Macro to delete text in specific styles Office 2010
Novice
 
Join Date: Jan 2019
Posts: 1
melp is on a distinguished road
Default

Hello I tried the below code but this is not working ie no text was deleted in my doc.
Could someone explain to me why?

Sub DeleteStyledText()
With ActiveDocument.Content.Find
.ClearFormatting
.Style = ActiveDocument.Styles("Heading 3")
Do While .Execute(FindText:="", Forward:=True, Format:=True) = True
.Parent.Delete


Loop
End With
End Sub

Thanks in advance

Mel
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to delete text in specific styles Delete specific text Jackson Word VBA 16 12-06-2019 08:24 PM
Macro to delete text in specific styles Macro to change specific text styles ljd108 Word VBA 3 10-22-2014 03:19 PM
Macro to delete text in specific styles Delete specific mass text on document JadeRisley Word 4 07-17-2013 11:11 PM
Macro to delete text in specific styles Using macro to delete styles fogharty Word 1 10-10-2011 03:42 PM
Macro to delete text in specific styles Need help extracting specific text from one doument to another with macro/VBA. zsmithku Word 1 04-15-2011 03:46 PM

Other Forums: Access Forums

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