Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 07-13-2018, 06:03 PM
macropod's Avatar
macropod macropod is offline Removing Empty Brackets In Batch Windows 7 64bit Removing Empty Brackets In Batch Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

With the code I posted, change the With wdDoc … End With block to:


Code:
    With wdDoc
      .ActiveWindow.View.ShowFieldCodes = True
      With .Range
        With .Find
          .ClearFormatting
          .Replacement.ClearFormatting
          .Text = "()"
          .Replacement.Text = ""
          .Forward = True
          .Format = False
          .Wrap = wdFindContinue
          .MatchWildcards = False
          .Execute Replace:=wdReplaceAll
          .Text = "(^d HYPERLINK"
          .Wrap = wdFindStop
          .Execute
        End With
        Do While .Find.Found = True
          .MoveEndUntil ")", wdForward
          .End = .End + 1
          .Delete
          .Collapse wdcollpaseend
          .Find.Execute
        Loop
      End With
      .ActiveWindow.View.ShowFieldCodes = False
      .Close SaveChanges:=True
    End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #17  
Old 07-16-2018, 05:39 AM
Agog Agog is offline Removing Empty Brackets In Batch Windows 10 Removing Empty Brackets In Batch Office 2016
Novice
Removing Empty Brackets In Batch
 
Join Date: May 2018
Posts: 11
Agog is on a distinguished road
Default

Sorry gmayor I had some errors while testing your code and didn't go too far into debug because macropods worked.

Thanks for your help people <3
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
If a2 is not empty, color empty cells in b2:af2 turkanet Excel 2 08-20-2017 11:00 PM
Removing Empty Brackets In Batch find and delet all text within brackets and the brackets themselves wrdy Word 2 08-03-2017 06:55 PM
Apparently empty (blank) cells aren't empty daymaker Excel 3 03-08-2012 03:41 PM
brackets citation uncung Word 1 07-13-2011 01:39 PM
Brackets Issue... DarkJudge1 Outlook 0 07-06-2010 05:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft