Macro that worked well in Word XP, but does not in Word 2007

A

Aeronav

Good morning, I posted this questionin vba.customization but did not get an
answer, maybe here ?
I am using WIN XP SP2, Word XP and Word 2007 fully updated, all in french
versions.
French Windows uses normally the comma as decimal separator and you need it
if you want to calculate. Entering numbers with decimals in a Word table is
easier if the decimal point key translates your command in the comma.
I used this macro in Word XP, stored in Normal.dot :
------------------
Public Sub PointOuVirgule()
CustomizationContext = NormalTemplate
If KeyBindings(1).command = Chr(46) Then
KeyBindings.Add KeyCategory:=wdKeyCategorySymbol,
KeyCode:=BuildKeyCode(wdKeyNumericDecimal), command:=Chr(44)
StatusBar = "Tu as la virgule"
Else
KeyBindings.Add KeyCategory:=wdKeyCategorySymbol,
KeyCode:=BuildKeyCode(wdKeyNumericDecimal), command:=Chr(46)
StatusBar = "Tu as le point"
End If
End Sub
------------------
Char(46) is the decimal point, Chr(44) is the comma.
It worked very well in Word XP but if I try to use it in Word 2007 I always
get the character 255, that is ÿ , and I am stuck to it. To get back to the
normal behaviour and retrieve the decimal point I am obliged to go the
customization of the keyboard and hit "Reset" .
Has anybody a cure for that ?
Thanks
 

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