Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to strip non-ascii characters from text

Status
Not open for further replies.

JohnVogel

Programmer
Apr 19, 1999
117
US
Part of a utility I am working gets the text in a word document and puts this in a (multi-line) textbox. I have no problem opening the doc and getting the information I need (using the automation method for Word)... only problem is there are non-ascii formatting characters in the text, which I need to get rid of. Can anyone tell me how to simply strip all non-ascii (except for the Cr/Lf charcters) from the text?



John Vogel
john@thecompuwizard.com
 
Great! That's pretty much what i was looking for... the only problem I am having now is keeping the vbCrLf (chr$(13) & Chr$(11))... while getting rid of the character formatting. Seems If I get rid of all occurances of CHR$(13) it will (of course) get rid of the crlf needed in the text box... err.. am I making any sense here?

John Vogel
john@thecompuwizard.com
 
Excuse me for being dense. I guess sometimes my brain gets so bogged down, the simplest solutions just go right over my head.

Just replace the str=CHR$(13) & CHR$(11) with vbCRLF and voila. At least I think it's that simple, but it's late so I'll get at this particular project tommorrow. I appreciate your help with jogging my memory on the replace command. Need to rest the brain before I go on, though, before I really mess something up (sometimes saving too often can be a curse :-D)

John Vogel
john@thecompuwizard.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top