Word VBA >> Testing for ansi 0145 and ansi 0146 in selection

by and » Mon, 09 Aug 2004 19:35:00 GMT

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
^^^^


Word VBA >> Testing for ansi 0145 and ansi 0146 in selection

by Helmut Weber » Mon, 09 Aug 2004 20:01:05 GMT


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
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98



Word VBA >> Testing for ansi 0145 and ansi 0146 in selection

by and » Mon, 09 Aug 2004 20:34:03 GMT

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
^^^^



Similar Threads

1. ANSI file format in Word 2003 missing

2. ANSI to Unicode symbol font conversion

Word 2004 cannot search for symbol font characters, even though it
clearly knows what they are because it displays them correctly. I need
a way to either convert the ANSI based symbol font characters to
Unicode equivalents or to be able to find them and replace them with
some kind of unique symbol. Visual Basic interprets all such characters
as character number 95.

The reason for this need: I have most of a physics book written in Word
2000, with extensive editing in Word 2004. I need to find and identify
symbol font characters for a Visusal Basic file conversion routine that
I have written as part of the need to put the manuscript mostly into
TeX for my publisher.

Any help might save me a lot of tedious find and replace manual
activity.....

3. How do I save a word doc as an ansi file in word 2003

4. convert to windows ansi code page

how can i convert from ASMO 449 code page to windows ansi code page?

5. In MS Word I lost the use of the ANSI Character set (ALT+0233) - Microsoft Office

6. Set text import query default to ANSI

I created an Excel 2002 CSV database query for importing reguarly created CSV 
files. The default text format is OEM, which will not import correctly.  
Setting the default table format to ANSI only works for files already within 
the directory - new files default to OEM.  Short of continually editing the 
ODBC definition (which works), how can I set the default text format to ANSI?

TIA,
Mike

7. error can't run Unicode version 4 ATL71.DLL install ANSI versi - Microsoft Office

8. ANSI

Where can I find a copy of the ANSI character set. I am seeking a numeric alphia character (an alpha character that can be used in a numeric field)