
December 10th, 2003, 12:27 PM
|
|
Contributing User
|
|
Join Date: Nov 2003
Posts: 40
Time spent in forums: 17 h 42 m
Reputation Power: 6
|
|
Find and replace problems
I have been working on a find and replace feature to speed up my job a little but am having major problems.
I have an access DB that contains the items I am searching for and the list of their respective replacements.
The object is to paste in html code and run the conversion so the script marks up acronyms (strSearch) with their proper <acronym> tags and titles (strReplace).
Let's suppose I have CCOD and CO as search strings. My script goes through and marks up the CCOD section fine and then Marks up the CO portion of CCOD which is not right.
Some one told me to put blank spaces on to the search string to avoid that problem. That worked great i had coded it so that the search string looked like:
strSearch= " " & strSearch & " "
and the replace file looked similar:
strReplace= " " & strReplace & " "
I run the replace() function using vbBinaryCompare as the acronyms are always in capital letters. All went well until I discovered these blank spaces caused another problem.
The reason this is an issue is because sometimes CCOD is actually (CCOD) with the paratheses or CCOD, with the comma, or CCOD- with the hyphen...etc you get the picture right.....
So I have to validate for many functions and seem to be having difficulties with hidden attributes. I had to validate for VbCrlf, VbTab, comma, - , (), etc... and still seems to crap out...
I'm thinking there must be an easier way.
Can someone please point me in another direction or something?
Thanks,
|