J
John McGhie [MVP - Word and Word Macintosh]
Hi Klaus:
Silly me, I believed the Help
Chr Function
Returns a String containing the character associated with the specified
character code.
Syntax Chr(charcode)
The required charcode argument is a Long that identifies a character.
Remarks
Numbers from 0 - 31 are the same as standard, nonprintable ASCII codes. For
example, Chr(13) returns a linefeed character. The normal range for charcode
is 0 - 255. However, on DBCS systems, the actual range for charcode is
-32768 to 65536.
Note The ChrB function is used with byte data contained in a String.
Instead of returning a character, which may be one or two bytes, ChrB always
returns a single byte. The ChrW function returns a String containing the
Unicode character except on platforms where Unicode is not supported, in
which case, the behavior is identical to the Chr function.
Visual Basic for the Macintosh does not support Unicode strings.
Consequently, ChrW(n) cannot return all Unicode characters for n values in
the range of 128-65,535, as it does in the Windows environment. Instead,
ChrW(n) attempts a "best guess" for Unicode values n greater than 127.
Therefore, you should not use ChrW in the Macintosh environment.
Cheers
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
Silly me, I believed the Help
Chr Function
Returns a String containing the character associated with the specified
character code.
Syntax Chr(charcode)
The required charcode argument is a Long that identifies a character.
Remarks
Numbers from 0 - 31 are the same as standard, nonprintable ASCII codes. For
example, Chr(13) returns a linefeed character. The normal range for charcode
is 0 - 255. However, on DBCS systems, the actual range for charcode is
-32768 to 65536.
Note The ChrB function is used with byte data contained in a String.
Instead of returning a character, which may be one or two bytes, ChrB always
returns a single byte. The ChrW function returns a String containing the
Unicode character except on platforms where Unicode is not supported, in
which case, the behavior is identical to the Chr function.
Visual Basic for the Macintosh does not support Unicode strings.
Consequently, ChrW(n) cannot return all Unicode characters for n values in
the range of 128-65,535, as it does in the Windows environment. Instead,
ChrW(n) attempts a "best guess" for Unicode values n greater than 127.
Therefore, you should not use ChrW in the Macintosh environment.
Cheers
Yes ... in Word2004.
ChrW and AscW are VB(A) string stuff (nothing to do with Word) and work
flawlessly even in Word X.
If something goes wrong, Word has messed up the character, and you'd need to
look at the rest of the code to see what happened.
You may find even Word X is better than you assume. Say,
Selection.InsertAfter ChrW(i)
will insert the "proper" Unicode character. The only problem I saw is that
Word might not be able to display the character (and shows an underscore).
Greetings,
Klaus
--
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 4 1209 1410