Testing for ansi 0145 and ansi 0146 in selection

A

and

Dear all,

1) I'm looking for a way to test whether the ansi-0145 and/or ansi-0146
(curly quotes ` and ') are present in a selection.

Does anyone know a method to tackle this problem? I do know how to
evaluate a selection character by character, so that's not the problem.
I tried the "asc" function, but that doesn't do the trick.

2) And I also would like to find a way to insert text containing these
ansi characters using VBA code. I ask this in the same thread, since I
suspect that the solution of both questions may be based on the same
principle.

Best regards,

AndY
^^^^
 
H

Helmut Weber

Hi Andy,
do you mean something like this:
With Selection
If InStr(.Text, Chr(146)) Then MsgBox "146 = yes"
If InStr(.Text, Chr(145)) Then MsgBox "145 = yes"
.WholeStory
.Collapse
.TypeText Text:=Chr(145) & "ddd" & Chr(146)
End With
 
A

and

Hi Helmut, that's exactly what I mean. It is so simple, but my Word XP
VBA Help files don't mention it explicitly.

So thank you very much!

AndY
^^^^
 

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