VBA - Convert all Special Characters to Text
Posted on 2003-04-01
There seems to be many ways of doing this - but I'm after a smart function that will forfill all the following string manipulation.
Background : I have a table of Word Documents that are going to sucked out, using stream read - the content becomes a String, which will be indexed by SQL Server indexing.
I have successful got the 'string' but when inserted into the 'pure text' column, contains lots of special characts (appear as square) and such like. Don't really want a clumsy 'replace(str,vbxxx," ")' over and over.
I would like
1. Anything more that a double space to be a single
2. No tabs, lf, crlf or any form of formatting like that
3. Character 1-9, A-Z + "*",".","£" etc ... to be ALLOWED (as people will search on .Net, C++ etc)
So basically, any 'normal' ascii should be fine - but ALL those strange formatting characters to be replaced by single space.
A nice callable function is what I'm after ... myString = CleanMyString(myString)
Thanks y'awl !