Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-06-2021, 04:17 AM
eduzs eduzs is offline Remove text between brackets, bookmarks. Windows 10 Remove text between brackets, bookmarks. Office 2019
Expert
Remove text between brackets, bookmarks.
 
Join Date: May 2017
Posts: 266
eduzs is on a distinguished road
Default Remove text between brackets, bookmarks.


This code should remove text between [] inserted in bookmarks, the problem is that it's removing the 1st bookmark at the start of the document.
Any ideas on how to adjust this?
Thanks.
Code:
Sub Test()
    With ActiveDocument.Content.Find
        .Text = "\[*\]"
        .Replacement.Text = ""
        .ClearFormatting
        .Replacement.ClearFormatting
        .MatchWildcards = True
        .Execute Replace:=wdReplaceAll
    End With
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove text between brackets, bookmarks. Formatting text within brackets jimmi6jjr Word 4 10-04-2022 09:33 PM
Remove text between brackets, bookmarks. find and delet all text within brackets and the brackets themselves wrdy Word 2 08-03-2017 06:55 PM
Remove text between brackets, bookmarks. Word 2003 Brackets appear around copied text barrage Word 1 12-16-2015 02:59 PM
Microsoft Word macro to find text, select all text between brackets, and delete helal1990 Word VBA 4 02-05-2015 03:52 PM
Remove text between brackets, bookmarks. Form updating Bookmarks - writes to the bookmarks multiple times PeterPlys Word VBA 13 01-14-2015 06:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:18 PM.


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