View Single Post
  #17   Report Post  
Posted to microsoft.public.word.newusers
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default Word 2003 - F1 and macros

Hi Tom,

It seems there is no end to the mysteries of Word. Right now I'm trying to
figure out why a macro I just wrote which does nothing but type some
formatted text into a document is triggered with the Shift-F11 key even
when I don't assign the macro to either a key or to a menu. If I add a
hotkey, (e.g. F11), then BOTH F11 and Shift-F11 trigger the macro. If I
delete the macro, Shift-F11 does nothing. If I manually create the macro
from scratch avoiding any key assignment, Shift-F11 will again trigger the
macro.

Strange, indeed. If you go to Tools/Customize/Keyboard, click in the box for
a new keyboard shortcut, then press Shift+F11 what appears in the empty
space below? "[Unassigned]" or something else (a command name)?


It comes up saying "Shift-F11 is assigned to:" and that's all. It doesn't
say unassigned.

Oh, yuck sigh I see "PrevField" right above the combobox "Save changes in".
You're sure it's just because your eyes didn't travel far enough to the right
:-)?

If there's really nothing there, you can try the following macro to find out to
what it's been assigned. Note: the macro should have only 18 lines when you've
copied it to the VB Editor (Alt+F11 in Word). If you see more, then it's broken
in the wrong place and we'll need to put humpty-dumpty back together. Only three
lines should start at the far left: Sub, Handler and End Sub

Sub GetKeyboardAssignment()
Application.CustomizationContext = NormalTemplate
On Error GoTo Handler
MsgBox Application.KeyBindings.Key( _
KeyCode:=BuildKeyCode(wdKeyShift, wdKeyF11)).Command

Exit Sub

Handler:
Select Case Err.Number
Case 91
MsgBox "The key combination has not been reassigned"
Case Else
MsgBox "Error: " & CStr(Err.Number) & vbCr & _
Err.Description
End Select
End Sub


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)