Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-26-2018, 07:37 AM
TomDW TomDW is offline Macro to remove underscores, except in email address Windows 10 Macro to remove underscores, except in email address Office 2016
Novice
Macro to remove underscores, except in email address
 
Join Date: Sep 2018
Posts: 3
TomDW is on a distinguished road
Default Macro to remove underscores, except in email address

Hi,



I'm trying to replace all underscores in a word document with a single space, except for underscores in email addresses.
Could someone please help?
I've got the following already:

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "_"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
End With
Selection.Find.Execute Replace:=wdReplaceAll


This will replace all underscores. I don't know how to ignore email addresses...
Thanks in advance!
Reply With Quote
 

Tags
macro replace email



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide Email Address of Previous Email when Replying or Forwarding bondingfortoday Outlook 0 03-05-2016 04:29 PM
Add link to email address that hides the actual address or makes it inaccessible to online bots richiebabes Word 1 09-03-2014 03:22 PM
Macro to send from non-default email address k.n. Mail Merge 5 12-03-2013 03:22 AM
Mail Merge Many URLs in one email by common email address instantaphex Mail Merge 3 04-29-2013 05:46 PM
Remove a Group Email address from Outlook meppwc Outlook 0 10-17-2012 07:09 AM

Other Forums: Access Forums

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