Microsoft Office Forums Search and replace symbols

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-26-2019, 06:14 PM
Chayes Chayes is offline Search and replace symbols Windows XP Search and replace symbols Office 2003
Advanced Beginner
Search and replace symbols
 
Join Date: May 2012
Posts: 76
Chayes is on a distinguished road
Default Search and replace symbols

Hi All


I've been writing some VBA to search and replace the random symbols which sometimes show up in emails. It effectively clears these out to leave a clean text.



This works well to a point , but always leaves certain symbols which refuse to be cleared. There is one which is particularly stubborn. I can copy the symbol from the page , but when I try to paste into the search and replace dialogue , they fail to paste.





I wonder if someone with greater expertise would be able to advise on a way to clear these symbols.


I've attached a sample file that shows the offending symbols.


Grateful for any help.
Attached Files
File Type: doc Sample.doc (24.0 KB, 2 views)
Reply With Quote
  #2  
Old 05-26-2019, 07:25 PM
macropod's Avatar
macropod macropod is online now Search and replace symbols Windows 7 64bit Search and replace symbols Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,680
macropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud of
Default

I assume you mean the ¬ characters. I have no problem pasting one of those into the Find dialogue. As their ASCII code is 172, you can also Find them via ^0172.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 05-26-2019, 08:25 PM
Chayes Chayes is offline Search and replace symbols Windows XP Search and replace symbols Office 2003
Advanced Beginner
Search and replace symbols
 
Join Date: May 2012
Posts: 76
Chayes is on a distinguished road
Default

Ok thanks. I used ^0172 , and this has worked fine now. Many of the symbols are unfamiliar of course and single entry search and replace is making for a very long macro. It does a fair job of cleaning up emails which tend to become full of them , but it's a pity there's no shorter method.
Reply With Quote
  #4  
Old 05-26-2019, 08:29 PM
macropod's Avatar
macropod macropod is online now Search and replace symbols Windows 7 64bit Search and replace symbols Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,680
macropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud of
Default

See: https://www.msofficeforums.com/word/...s-e-mails.html
The code there will do most of the work. Admittedly, characters like ¬ aren't dealt with as they're not normally found in emails. That said, they and any other characters you want to delete (or replace with spaces) could easily be added to a single wildcard Find expression.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 05-27-2019, 07:07 AM
Chayes Chayes is offline Search and replace symbols Windows XP Search and replace symbols Office 2003
Advanced Beginner
Search and replace symbols
 
Join Date: May 2012
Posts: 76
Chayes is on a distinguished road
Default

Ok thanks for your help. I've got it working substantially correctly now , but appreciate it's difficult to be entirely accurate in clearing everything to leave pristine text.
Reply With Quote
  #6  
Old 05-27-2019, 08:09 AM
Chayes Chayes is offline Search and replace symbols Windows 7 32bit Search and replace symbols Office 2003
Advanced Beginner
Search and replace symbols
 
Join Date: May 2012
Posts: 76
Chayes is on a distinguished road
Default

BTW - do you know of a single wildcard expression which would remove these unwanted symbols? I imagine it would have to seek to remove anything that was not a character , not a digit , not comma , not full stop , not apostrophe etc. I'm afraid such a coding would be above my abilities , but if you have such a thing I'd be grateful.
Reply With Quote
  #7  
Old 05-27-2019, 03:58 PM
macropod's Avatar
macropod macropod is online now Search and replace symbols Windows 7 64bit Search and replace symbols Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,680
macropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud of
Default

Quote:
Originally Posted by Chayes View Post
Ok thanks for your help. I've got it working substantially correctly now , but appreciate it's difficult to be entirely accurate in clearing everything to leave pristine text.
Not really - it just takes knowing what the clean-up entails along with a bit of care.
Quote:
Originally Posted by Chayes View Post
BTW - do you know of a single wildcard expression which would remove these unwanted symbols?
Without knowing what all "these unwanted symbols" are, it's impossible to say. As I said before, though, characters like ¬ aren't normally found in emails, so I don't really know what you're dealing with.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #8  
Old 05-27-2019, 04:43 PM
Chayes Chayes is offline Search and replace symbols Windows 7 32bit Search and replace symbols Office 2003
Advanced Beginner
Search and replace symbols
 
Join Date: May 2012
Posts: 76
Chayes is on a distinguished road
Default

Yes I agree that with a little painstaking weeding , all can be restored to it's original state. I'm finding that the more an email conversion has passed back and forth in transport , the more complicated it becomes to unpick. The harder part is restoring shape and coherence to the text during the search and replace procedures. I'm trying really to arrive at a macro that can be applied to any email and give a good result. This may be forlorn , of course , but I'll do my best.




Reply With Quote
  #9  
Old 05-27-2019, 04:47 PM
macropod's Avatar
macropod macropod is online now Search and replace symbols Windows 7 64bit Search and replace symbols Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,680
macropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud of
Default

Since you seem not to be inclined to say what the other problem symbols/characters are, or how you want them treated, I can't really help you any further.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #10  
Old 05-29-2019, 06:10 AM
Chayes Chayes is offline Search and replace symbols Windows 7 32bit Search and replace symbols Office 2003
Advanced Beginner
Search and replace symbols
 
Join Date: May 2012
Posts: 76
Chayes is on a distinguished road
Default

Ok I'll attach a sample file to show the extent of the issue. You'll be able to see the symbols we're dealing with.



The harder part I'm finding is leaving reconstituted text as it was originally sent. I've removed names and email addresses from the file , otherwise it's exactly as sent originally.


Grateful for your help.
Attached Files
File Type: doc Sample2.doc (108.5 KB, 2 views)
Reply With Quote
  #11  
Old 05-29-2019, 04:00 PM
macropod's Avatar
macropod macropod is online now Search and replace symbols Windows 7 64bit Search and replace symbols Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,680
macropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud ofmacropod has much to be proud of
Default

It seems to me you could do the vast majority of the clean-up with a single wildcard Find/Replace expression:
Find = [ \>…ΒΓΕΖ‚'ƒβ€š¬‘’†™Ύ]{2,}
Replace = nothing
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #12  
Old 05-30-2019, 01:38 PM
Chayes Chayes is offline Search and replace symbols Windows 7 32bit Search and replace symbols Office 2003
Advanced Beginner
Search and replace symbols
 
Join Date: May 2012
Posts: 76
Chayes is on a distinguished road
Default

Ok thanks. That's much neater , and is considerably more elegant than my solution.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and replace symbols Search and replace hernans Word VBA 5 07-02-2018 07:01 PM
Search and replace symbols Find and replace symbols help gogreen Word 10 02-28-2017 05:00 PM
replace words between two symbols capitala Word VBA 9 02-03-2014 03:57 AM
Search and Replace - Clear Search box JostClan Word 1 05-04-2010 08:46 PM
Search and replace symbols Find and Replace - symbols clisco Word 5 01-03-2010 05:57 AM


All times are GMT -7. The time now is 05:48 PM.


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