Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-11-2022, 03:41 PM
macropod's Avatar
macropod macropod is offline run vba script in word for removing certain characters Windows 10 run vba script in word for removing certain characters Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,355
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


You can't put those variations all into a single Find expression. You could use a macro, however, to automate the process. For example:
Code:
Sub BulkFindReplace()
Application.ScreenUpdating = False
Dim ArrFnd As Variant, i As Long
'Array of wildcard Find expressions
ArrFnd = Array("[*\]", "[\*“”""""]")
With ActiveDocument.Range.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Format = False
  .Forward = True
  .MatchWildcards = True
  .Replacement.Text = ""
   'Process each item from ArrFnd
  For i = 1 To UBound(ArrFnd)
    .Text = ArrFnd(i)
    .Execute Replace:=wdReplaceAll
  Next
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 05-12-2022, 05:57 AM
Mattc1978 Mattc1978 is offline run vba script in word for removing certain characters Windows 10 run vba script in word for removing certain characters Office 2019
Novice
run vba script in word for removing certain characters
 
Join Date: May 2021
Posts: 13
Mattc1978 is on a distinguished road
Thumbs up Macro worked!!!

Hi Macropod,

Can you add change font to arial and remove these types of brackets also [ ]

Many Thanks

How would you best recommend to learn Macro?

Thanks

Matt
Reply With Quote
Reply

Tags
ctrlh, dunce, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
run vba script in word for removing certain characters Visual basic Word Script To Remove Specific Areas of a Word Doc mackied Word VBA 9 07-30-2017 03:10 PM
run vba script in word for removing certain characters Removing characters from a cell tonydoneese Excel 4 01-12-2016 07:41 AM
Strange Characters appear when selecting SHOW ALL NON PRINTING CHARACTERS ann Amber Word 1 08-01-2015 08:06 PM
Junk characters (box-like characters) in Word file Sashikala Word 1 04-20-2010 02:03 PM
Removing data between two characters Voodoo Child Excel 1 11-26-2009 01:39 PM

Other Forums: Access Forums

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