Word 2003 - F1 and macros
On Fri, 22 Sep 2006 11:21:47 +0200, Cindy M.
wrote:
I don't think this is unique to Word 2003 (I noticed the same thing in Word
2000) - but why can't the F1 key be used for a macro instead of to bring up
Help? Does anyone know - or IS there in fact a way to assign F1 to execute
a macro?
There is, but it requires a macro. The basic code is as follows. Note the
CustomizationContext: you need to set this to where you want the assignment
to be valid.
I want the assignment to be globally available to all documents and
templates.
"TestWord" is the name of the macro.
Application.CustomizationContext = ActiveDocument
Application.KeyBindings.Add wdKeyCategoryMacro, "TestWord", wdKeyF1
I opened normal.dot, created a macro called Autoexec, and copied your code
into that macro.
When I ran the autoexec manually, I got the following:
Run-time error 5346
Word cannot change the function of the specified key.
I then closed Word and restarted it. Now every time I open word, I get the
following:
Run-time error 4248
This command is not available because no document is open.
I then created a macro called "TestWord" and copied your code into that
macro. I then ran the macro and got no errors.
I started to record a macro, but Word would still not let me use the F1
key.
Color me confused,
Tom
--
remove .spoo to reply by email
|