Textbox Font reverts to Tahoma
I have an unusual problem that happens on both Win98 and WinXP running Word 2002 (SP3) using VBA 6.3. For what it's worth, all Autocorrect options are turned off.
I want to be able to display text in a specific font in a TextBox. The problem is, when I set the value of the TextBox to a string containing characters like Chr(131), Chr(138) or Chr(160), the font for the remaining characters in the TextBox revert to Tahoma if their character index is greater than 130. When I manually enter text into a TextBox, I can cause a similar problem to occur using the characters 131 and 138. (Note that Tahoma is still the default font for TextBoxes on my system.)
This will recreate the problem to demonstrate what I mean;
1) In Word, create a form with a Textbox
2) Set the TextBox font to a font other than Tahoma but
not a symbol font. Choose a font that looks significantly
different - specially the character 131 (Looks like
a comma). Make the font large so the difference is
obvious.
3) Run the form
4) In the TextBox, press alt while entering 0130
You should get a comma
5) Press backspace and delete the comma
6) Now, in the TextBox, press alt while entering 0131
You should get the function sign Æ
7) Press backspace and delete function sign Æ
8) Now press alt while entering 0130 again
You get a comma but the font is now Tahoma
Are these characters reserved for special purposes? I have searched all over the net for a solution to this problem or an indication as to why this is happening with no luck. Any help would be greatly appreciated.
|