Ascii characters don't correspond to their codes

D

Dave Neve

Hi

I've noticed recently doing VBA that my ascii characters do not correspond
to their given codes.

I click on the 'special characters' entry in the menu bar of Word and note
down the corresponding ascii number but when I type out alt+number, I often
get sth else.

I have to say that I work on a multi language computer with keyboards in
various languages and this may be the cause of the problem as some ascii
characters are lang setting sensitive.

But what can I do to get the characters to answer to their codes as
displayed in Word?

Thanks in advance
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Dave,

I have never encountered that problem. Are you sure that you are not
hitting the wrong keys?

Try running the macro below and see if it produces the following in the
first and second columns of the table that it creates:

Alt + Numeric Keypad - Normal Font

033 - !

034 - "

035 - #

036 - $

037 - %

038 - &

039 - '

040 - (

041 - )

042 - *

043 - +

044 - ,

045 - -

046 - .

047 - /

048 - 0

049 - 1

050 - 2

051 - 3

052 - 4

053 - 5

054 - 6

055 - 7

056 - 8

057 - 9

058 - :

059 - ;

060 - <

061 - =

062 - >

063 - ?

064 - @

065 - A

066 - B

067 - C

068 - D

069 - E

070 - F

071 - G

072 - H

073 - I

074 - J

075 - K

076 - L

077 - M

078 - N

079 - O

080 - P

081 - Q

082 - R

083 - S

084 - T

085 - U

086 - V

087 - W

088 - X

089 - Y

090 - Z

091 - [

092 - \

093 - ]

094 - ^

095 - _

096 - `

097 - a

098 - b

099 - c

0100 - d

0101 - e

0102 - f

0103 - g

0104 - h

0105 - i

0106 - j

0107 - k

0108 - l

0109 - m

0110 - n

0111 - o

0112 - p

0113 - q

0114 - r

0115 - s

0116 - t

0117 - u

0118 - v

0119 - w

0120 - x

0121 - y

0122 - z

0123 - {

0124 - |

0125 - }

0126 - ~

0127 - 

0128 - €

0129 -

0130 - ‚

0131 - ƒ

0132 - „

0133 - …

0134 - †

0135 - ‡

0136 - ˆ

0137 - ‰

0138 - Š

0139 - ‹

0140 - Œ

0141 -

0142 - Ž

0143 -

0144 -

0145 - ‘

0146 - ’

0147 - “

0148 - ”

0149 - •

0150 - –

0151 - —

0152 - ˜

0153 - ™

0154 - š

0155 - ›

0156 - œ

0157 -

0158 - ž

0159 - Ÿ

0160 -

0161 - ¡

0162 - ¢

0163 - £

0164 - ¤

0165 - ¥

0166 - ¦

0167 - §

0168 - ¨

0169 - ©

0170 - ª

0171 - «

0172 - ¬

0173 - ­

0174 - ®

0175 - ¯

0176 - °

0177 - ±

0178 - ²

0179 - ³

0180 - ´

0181 - µ

0182 - ¶

0183 - ·

0184 - ¸

0185 - ¹

0186 - º

0187 - »

0188 - ¼

0189 - ½

0190 - ¾

0191 - ¿

0192 - À

0193 - Á

0194 - Â

0195 - Ã

0196 - Ä

0197 - Å

0198 - Æ

0199 - Ç

0200 - È

0201 - É

0202 - Ê

0203 - Ë

0204 - Ì

0205 - Í

0206 - Î

0207 - Ï

0208 - Ð

0209 - Ñ

0210 - Ò

0211 - Ó

0212 - Ô

0213 - Õ

0214 - Ö

0215 - ×

0216 - Ø

0217 - Ù

0218 - Ú

0219 - Û

0220 - Ü

0221 - Ý

0222 - Þ

0223 - ß

0224 - à

0225 - á

0226 - â

0227 - ã

0228 - ä

0229 - å

0230 - æ

0231 - ç

0232 - è

0233 - é

0234 - ê

0235 - ë

0236 - ì

0237 - í

0238 - î

0239 - ï

0240 - ð

0241 - ñ

0242 - ò

0243 - ó

0244 - ô

0245 - õ

0246 - ö

0247 - ÷

0248 - ø

0249 - ù

0250 - ú

0251 - û

0252 - ü

0253 - ý

0254 - þ

0255 - ÿ


' Macro created 12-08-98 by Doug Robbins to list symbols that can be
inserted via Alt+keypad
'
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1,
NumColumns:=3
Selection.TypeText Text:="Alt + Numeric Keypad"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="Normal Font"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="Symbol Font"
Selection.MoveRight Unit:=wdCell
Symbol = 33
While Symbol < 256
Selection.TypeText Text:="0" & LTrim$(Str$(Symbol))
Selection.MoveRight Unit:=wdCell
With Selection
.InsertSymbol CharacterNumber:=Symbol, Font:="Normal",
Unicode:=False
End With
Selection.MoveRight Unit:=wdCell
With Selection
.InsertSymbol CharacterNumber:=Symbol, Font:="Symbol",
Unicode:=False
End With
Symbol = Symbol + 1
Selection.MoveRight Unit:=wdCell
Wend


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
D

Dave Neve

Hello

Funny that you should suggest this cos about 10 days ago, that's exactly
what I tried to do (and again today).

As soon as I get (or the program) gets to ascii 135, Word crashes and even
CTRL+ALT+Pause doesn't help.

I've compared my ascii characters in Word (as displayed in the special
character Window ) with what I get when I type and it's definately not the
same.

I was going to give you characters 130-140 when inserted using this window
and then the characters 130-140 inserted using the numeric keys but the
first part of the operation crashed Word.

My ex multiple lang settings (cos I've now taken out a number of languages)
has done sth to Word.

Regards

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL
ADDRESS said:
Hi Dave,

I have never encountered that problem. Are you sure that you are not
hitting the wrong keys?

Try running the macro below and see if it produces the following in
the first and second columns of the table that it creates:

Alt + Numeric Keypad - Normal Font

033 - !

034 - "

035 - #

036 - $

037 - %

038 - &

039 - '

040 - (

041 - )

042 - *

043 - +

044 - ,

045 - -

046 - .

047 - /

048 - 0

049 - 1

050 - 2

051 - 3

052 - 4

053 - 5

054 - 6

055 - 7

056 - 8

057 - 9

058 - :

059 - ;

060 - <

061 - =

062 - >

063 - ?

064 - @

065 - A

066 - B

067 - C

068 - D

069 - E

070 - F

071 - G

072 - H

073 - I

074 - J

075 - K

076 - L

077 - M

078 - N

079 - O

080 - P

081 - Q

082 - R

083 - S

084 - T

085 - U

086 - V

087 - W

088 - X

089 - Y

090 - Z

091 - [

092 - \

093 - ]

094 - ^

095 - _

096 - `

097 - a

098 - b

099 - c

0100 - d

0101 - e

0102 - f

0103 - g

0104 - h

0105 - i

0106 - j

0107 - k

0108 - l

0109 - m

0110 - n

0111 - o

0112 - p

0113 - q

0114 - r

0115 - s

0116 - t

0117 - u

0118 - v

0119 - w

0120 - x

0121 - y

0122 - z

0123 - {

0124 - |

0125 - }

0126 - ~

0127 - 

0128 - €

0129 -

0130 - ‚

0131 - ƒ

0132 - „

0133 - …

0134 - †

0135 - ‡

0136 - ˆ

0137 - ‰

0138 - Š

0139 - ‹

0140 - Œ

0141 -

0142 - Ž

0143 -

0144 -

0145 - ‘

0146 - ’

0147 - “

0148 - ”

0149 - •

0150 - –

0151 - —

0152 - ˜

0153 - ™

0154 - š

0155 - ›

0156 - œ

0157 -

0158 - ž

0159 - Ÿ

0160 -

0161 - ¡

0162 - ¢

0163 - £

0164 - ¤

0165 - ¥

0166 - ¦

0167 - §

0168 - ¨

0169 - ©

0170 - ª

0171 - «

0172 - ¬

0173 - ­

0174 - ®

0175 - ¯

0176 - °

0177 - ±

0178 - ²

0179 - ³

0180 - ´

0181 - µ

0182 - ¶

0183 - ·

0184 - ¸

0185 - ¹

0186 - º

0187 - »

0188 - ¼

0189 - ½

0190 - ¾

0191 - ¿

0192 - À

0193 - Á

0194 - Â

0195 - Ã

0196 - Ä

0197 - Å

0198 - Æ

0199 - Ç

0200 - È

0201 - É

0202 - Ê

0203 - Ë

0204 - Ì

0205 - Í

0206 - Î

0207 - Ï

0208 - Ð

0209 - Ñ

0210 - Ò

0211 - Ó

0212 - Ô

0213 - Õ

0214 - Ö

0215 - ×

0216 - Ø

0217 - Ù

0218 - Ú

0219 - Û

0220 - Ü

0221 - Ý

0222 - Þ

0223 - ß

0224 - à

0225 - á

0226 - â

0227 - ã

0228 - ä

0229 - å

0230 - æ

0231 - ç

0232 - è

0233 - é

0234 - ê

0235 - ë

0236 - ì

0237 - í

0238 - î

0239 - ï

0240 - ð

0241 - ñ

0242 - ò

0243 - ó

0244 - ô

0245 - õ

0246 - ö

0247 - ÷

0248 - ø

0249 - ù

0250 - ú

0251 - û

0252 - ü

0253 - ý

0254 - þ

0255 - ÿ


' Macro created 12-08-98 by Doug Robbins to list symbols that can be
inserted via Alt+keypad
'
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1,
NumColumns:=3
Selection.TypeText Text:="Alt + Numeric Keypad"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="Normal Font"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="Symbol Font"
Selection.MoveRight Unit:=wdCell
Symbol = 33
While Symbol < 256
Selection.TypeText Text:="0" & LTrim$(Str$(Symbol))
Selection.MoveRight Unit:=wdCell
With Selection
.InsertSymbol CharacterNumber:=Symbol, Font:="Normal",
Unicode:=False
End With
Selection.MoveRight Unit:=wdCell
With Selection
.InsertSymbol CharacterNumber:=Symbol, Font:="Symbol",
Unicode:=False
End With
Symbol = Symbol + 1
Selection.MoveRight Unit:=wdCell
Wend



Hope this helps
Doug Robbins - Word MVP
Dave Neve said:
Hi

I've noticed recently doing VBA that my ascii characters do not
correspond to their given codes.

I click on the 'special characters' entry in the menu bar of Word
and note
down the corresponding ascii number but when I type out alt+number, I
often
get sth else.

I have to say that I work on a multi language computer with
keyboards in various languages and this may be the cause of the
problem as some ascii characters are lang setting sensitive.

But what can I do to get the characters to answer to their codes as
displayed in Word?

Thanks in advance
 

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