Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 05-28-2021, 03:22 PM
Guessed's Avatar
Guessed Guessed is offline Enclose All Instances of a Specific Custom Style in Brackets Windows 10 Enclose All Instances of a Specific Custom Style in Brackets Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

This gets rid of EVERY bracket in that style - including ones that the earlier macro didn't put in.
Code:
Sub RemoveBracketsUPDATED()
  With Selection.Find
    .ClearFormatting
    .Style = ActiveDocument.Styles("Normal")
    .Text = "[\(\)]{1}"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .MatchWildcards = True
    .Format = True
    .Execute Replace:=wdReplaceAll
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Enclose All Instances of a Specific Custom Style in Brackets find and delet all text within brackets and the brackets themselves wrdy Word 2 08-03-2017 06:55 PM
Enclose All Instances of a Specific Custom Style in Brackets Word forces use of a specific style C_Hawk1996 Word 1 04-13-2016 05:35 AM
Enclose All Instances of a Specific Custom Style in Brackets How to set the left indent in a specific style. OfficeBoy95 Word 2 05-12-2014 06:31 PM
How do I add a custom style to tab button? kennethc Word 1 04-11-2014 05:25 PM
How to set style automatically for specific texts ragesz Word 2 07-25-2013 07:08 AM

Other Forums: Access Forums

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