Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-12-2013, 02:30 AM
Aquinax Aquinax is offline make VBA utilize the right Alt codes scheme Windows XP make VBA utilize the right Alt codes scheme Office 2007
Novice
make VBA utilize the right Alt codes scheme
 
Join Date: Jun 2013
Posts: 17
Aquinax is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 06-18-2013, 04:55 AM
Aquinax Aquinax is offline make VBA utilize the right Alt codes scheme Windows XP make VBA utilize the right Alt codes scheme Office 2003
Novice
make VBA utilize the right Alt codes scheme
 
Join Date: Jun 2013
Posts: 17
Aquinax is on a distinguished road
Default 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.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Office 2007 Color Scheme issue Rothalax Office 0 05-22-2013 06:03 AM
make VBA utilize the right Alt codes scheme Codes Popping Up In My Text? Faedrie Word 1 11-08-2012 01:00 AM
make VBA utilize the right Alt codes scheme Losing VBA codes in .dotm tinfanide Word VBA 15 04-12-2012 12:39 AM
make VBA utilize the right Alt codes scheme 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

Other Forums: Access Forums

All times are GMT -7. The time now is 11:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft