regexp pattern question again

V

vbaNOOB

Hi,

Do any1 know how to write a regexp pattern to filter out all Chr(150) in the
string?

Many Thanks
 
H

Helmut Weber

Hi vbaNOOB,

no regexp required.
Regexp is meaningless anyway, when processing a single character.

strtmp = replace(strTmp, chr(150), "")

The question is, how did you get the chr(150) in the string at first?

When copying text containing chr(150) from a word-doc
into the VBA-editor, it is converted to chr(45).
However, using alt 0150 in the editor, you can produce a chr(150),
though it is represented by chr(45).

For a word.doc, e.g.

selection.range.text = _
replace(selection.range.text, chr(150), "")

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"




However, when copy a range of text from >Hi,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top