#1
|
|||
|
|||
VBA uses wrong Alt codes !!!
I've created a macro which replaces signs \|:/*?<> (which cannot be used in file names) with other characters. VBA is to use alt codes for that task and most characters are being replaced ok, yet some characters VBA puts are, as I've noticed, alien to the standard Alt codes table, Thus the character '¿' with the alt code 0191 is being typed by the VBA as ' ї ' and '►' as '+'. The issue here, as I've figured out, lies in the cyrillic keyboard layout which the VBA for some reasons utilizes (^0191, ^0192, ^0193, ^0194 are referenced by " ї, A, Б, В, Г " in the Cyrillic alt code table instead of " ¿, └, Á, Â, Ã " in the Western type). I've had a Russian keyboard layout installed, yet VBA still types the characters incorrectly even after I've removed it, Word itself (I'm using the 2003 version) fetches the correct characters (in compliance with the Western keyboard type). Can the VBA be somehow 'told' to use the Western type layout ?? How else can it possibly be made to use the right alt codes ? Last edited by Aquinax; 06-13-2013 at 04:41 AM. |
#2
|
|||
|
|||
problem SOLVED
The reason for the wrong alt codes was "language for non-Unicode programs" in "Regional and Language options" which was set for the Russian language. Having switched it to English, the characters produced by the VBA engine reverted back to the Latin characters. It is also true that 'ChrW(####)' used in the VBA code to produce alt code characters is more consistent and reliable than '^####', though unfortunately I have not figured out how to type more than one character with the help of it.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Office 2007 Color Scheme issue | Rothalax | Office | 0 | 05-22-2013 06:03 AM |
Codes Popping Up In My Text? | Faedrie | Word | 1 | 11-08-2012 01:00 AM |
Losing VBA codes in .dotm | tinfanide | Word VBA | 15 | 04-12-2012 12:39 AM |
Outline Codes | eliz.bell | Word | 4 | 03-28-2012 07:27 PM |
Why run-time is always different from stepping into the codes? | tinfanide | Excel Programming | 1 | 03-04-2012 12:04 AM |