This question deals with Word 2003 on Windows XP.

I know, in general, how to add a command or macro to the toolbar by
clicking on Tools>Customize, clicking on the Commands tab, scrolling
down the Categories list on the left side, highlighting the appropriate
category, and then dragging the appropriate item to the menu bar. But
not everything can be got to that way.

For example, I would like to have a menu item or button that enables one
to go immediately to the dialog box that opens when one clicks
Tools>Customize>Keyboard with Macros highlighted in the left-hand side.
The keystrokes, which are not recordable to bring up this dialog, in the
macro recorder, would b. the following: <alt><T>, <alt><C>, <alt><K>,
<alt>C>, <M>,<M>,<Right>.

How would I write a macro that does this? I have an AutoHotKey script
that does this, but I wanted to have a macro that does this.

Regards,

Alan Stancliff

Re: Macro to open built-in dialog in Word 2003 by Doug

Doug
Tue Feb 26 01:30:45 PST 2008

Using the SendKeys command might do it.

SendKeys "%T%C%K%C{M 2}{Right}"

I can't test it as I am using 2007 in which the Tools>Customize dialog is
not available. That is not quite true, it inserted the local time in AM/PM
format followed by MM

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Alan Stancliff" <alanstancliff@nojunkyahoo.com> wrote in message
news:uPO5%23LEeIHA.1168@TK2MSFTNGP02.phx.gbl...
> This question deals with Word 2003 on Windows XP.
>
> I know, in general, how to add a command or macro to the toolbar by
> clicking on Tools>Customize, clicking on the Commands tab, scrolling down
> the Categories list on the left side, highlighting the appropriate
> category, and then dragging the appropriate item to the menu bar. But not
> everything can be got to that way.
>
> For example, I would like to have a menu item or button that enables one
> to go immediately to the dialog box that opens when one clicks
> Tools>Customize>Keyboard with Macros highlighted in the left-hand side.
> The keystrokes, which are not recordable to bring up this dialog, in the
> macro recorder, would b. the following: <alt><T>, <alt><C>, <alt><K>,
> <alt>C>, <M>,<M>,<Right>.
>
> How would I write a macro that does this? I have an AutoHotKey script that
> does this, but I wanted to have a macro that does this.
>
> Regards,
>
> Alan Stancliff



Re: Macro to open built-in dialog in Word 2003 by Alan

Alan
Tue Feb 26 01:52:21 PST 2008

Doug Robbins - Word MVP wrote:
> Using the SendKeys command might do it.
>
> SendKeys "%T%C%K%C{M 2}{Right}"
>
> I can't test it as I am using 2007 in which the Tools>Customize dialog is
> not available. That is not quite true, it inserted the local time in AM/PM
> format followed by MM
>
Thanks for the idea. I did not know that VBA had SendKeys. I did try
your example, but unfortunately it did nothing at all. I tried setting
wait to true and a few other things.

Here's my latest go:

Sub eraseme()
'
'
Dialogs(wdDialogToolsCustomizeKeyboard).Display
SendKeys "m", True
SendKeys "m", True
SendKeys "{right}", True
End Sub

This got me as far as the keystrokes:
<alt><T>, <alt><C>, <alt><K>
which brings up the customize keyboard dialog. What it does not do is
send the <m>, <m>,<right>, which would move the selection bar in the
categories list on the upper left and shift focus to the Macros list on
the upper right. That's where I want to end up. Any ideas anyone?

Regards,

Alan

Re: Macro to open built-in dialog in Word 2003 by Graham

Graham
Tue Feb 26 02:13:34 PST 2008


Try

SendKeys "%T%C%K%C{M 2}"
Dialogs(wdDialogToolsCustomize).Show

or simply

SendKeys "{M}"
Dialogs(wdDialogToolsCustomizeKeyboard).Show

instead!

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Alan Stancliff wrote:
> Doug Robbins - Word MVP wrote:
>> Using the SendKeys command might do it.
>>
>> SendKeys "%T%C%K%C{M 2}{Right}"
>>
>> I can't test it as I am using 2007 in which the Tools>Customize
>> dialog is not available. That is not quite true, it inserted the
>> local time in AM/PM format followed by MM
>>
> Thanks for the idea. I did not know that VBA had SendKeys. I did try
> your example, but unfortunately it did nothing at all. I tried setting
> wait to true and a few other things.
>
> Here's my latest go:
>
> Sub eraseme()
> '
> '
> Dialogs(wdDialogToolsCustomizeKeyboard).Display
> SendKeys "m", True
> SendKeys "m", True
> SendKeys "{right}", True
> End Sub
>
> This got me as far as the keystrokes:
> <alt><T>, <alt><C>, <alt><K>
> which brings up the customize keyboard dialog. What it does not do is
> send the <m>, <m>,<right>, which would move the selection bar in the
> categories list on the upper left and shift focus to the Macros list
> on the upper right. That's where I want to end up. Any ideas anyone?
>
> Regards,
>
> Alan



Re: Macro to open built-in dialog in Word 2003 by Alan

Alan
Tue Feb 26 02:42:06 PST 2008

Thanks Graham,

Those worked wonderfully well, especially the second:

SendKeys "{M}"
Dialogs(wdDialogToolsCustomizeKeyboard).Show

Once again you guys have been wonderfully helpful.

Regards,

Alan Stancliff


Graham Mayor wrote:
> Try
>
> SendKeys "%T%C%K%C{M 2}"
> Dialogs(wdDialogToolsCustomize).Show
>
> or simply
>
> SendKeys "{M}"
> Dialogs(wdDialogToolsCustomizeKeyboard).Show
>
> instead!
>

Re: Macro to open built-in dialog in Word 2003 by Graham

Graham
Tue Feb 26 03:08:22 PST 2008

You are welcome :)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Alan Stancliff wrote:
> Thanks Graham,
>
> Those worked wonderfully well, especially the second:
>
> SendKeys "{M}"
> Dialogs(wdDialogToolsCustomizeKeyboard).Show
>
> Once again you guys have been wonderfully helpful.
>
> Regards,
>
> Alan Stancliff
>
>
> Graham Mayor wrote:
>> Try
>>
>> SendKeys "%T%C%K%C{M 2}"
>> Dialogs(wdDialogToolsCustomize).Show
>>
>> or simply
>>
>> SendKeys "{M}"
>> Dialogs(wdDialogToolsCustomizeKeyboard).Show
>>
>> instead!



Re: Macro to open built-in dialog in Word 2003 by Alan

Alan
Tue Feb 26 03:06:54 PST 2008

Graham Mayor wrote:
> Try
You know, I have to ask. Why does doing the SendKeys before opening the
dialog work and not visa versa. Somehow, that seems counterintuitive to me.

I'm just trying to understand the logic behind all this.

Regards,

Alan

>
> SendKeys "%T%C%K%C{M 2}"
> Dialogs(wdDialogToolsCustomize).Show
>
> or simply
>
> SendKeys "{M}"
> Dialogs(wdDialogToolsCustomizeKeyboard).Show
>
> instead!
>

Re: Macro to open built-in dialog in Word 2003 by Alan

Alan
Tue Feb 26 03:07:11 PST 2008

Graham Mayor wrote:
> Try
You know, I have to ask. Why does doing the SendKeys before opening the
dialog work and not visa versa. Somehow, that seems counterintuitive to me.

I'm just trying to understand the logic behind all this.

Regards,

Alan

>
> SendKeys "%T%C%K%C{M 2}"
> Dialogs(wdDialogToolsCustomize).Show
>
> or simply
>
> SendKeys "{M}"
> Dialogs(wdDialogToolsCustomizeKeyboard).Show
>
> instead!
>

Re: Macro to open built-in dialog in Word 2003 by Alan

Alan
Tue Feb 26 03:08:14 PST 2008

Graham Mayor wrote:
> Try
You know, I have to ask. Why does doing the SendKeys before opening the
dialog work and not visa versa. Somehow, that seems counterintuitive to me.

I'm just trying to understand the logic behind all this.

Regards,

Alan

>
> SendKeys "%T%C%K%C{M 2}"
> Dialogs(wdDialogToolsCustomize).Show
>
> or simply
>
> SendKeys "{M}"
> Dialogs(wdDialogToolsCustomizeKeyboard).Show
>
> instead!
>


Re: Macro to open built-in dialog in Word 2003 by Alan

Alan
Tue Feb 26 20:11:11 PST 2008

My apologies for the double-posting. I was having a bit of a problem
with my software.

Regards,

Alan Stancliff