Some time ago, someone on this forum wrote a macro for me to change letterspacing (Kerning) between letters. If the shift key is held when the macro icon is clicked, the letterspacing is reduced by one point. If the shift key is not held down, then the letterspacing is reduced by 1/4 pt.
The macro works fine when using the shift key, but when not using the shift key,I have to click the macro button (I put one in the toolbar for this macro) 3 times for it to work once. When using the Shift key, the letterspacing reduces with every click. Could someone check the code and see if they can see why it takes 3 clicks for the 1/4 pt reduction?
Dim FF As Object
Dim x
On Error GoTo -1: On Error GoTo UserCancel
If WordBasic.SelType() = 2 Then
Set FF = WordBasic.DialogRecord.FormatFont(False)
WordBasic.CurValues.FormatFont FF
If GetAsyncKeyState(16) < 0 Then
x = WordBasic.Val(FF.Spacing) – 1
Else
x = WordBasic.Val(FF.Spacing) – 0.25
End If
WordBasic.FormatFont Spacing:=Str(x)
End If
UserCancel: