Keyboard shortcut combo won't fire macro

  • Thread starter Artful_Dodger via OfficeKB.com
  • Start date
A

Artful_Dodger via OfficeKB.com

I created a macro to format text (indent both side of text for a long
quotation).

Then I assigned a new shortcut key (Ctrl-M) combo to that macro thru
Customize-->Keyboard.

It's worked in the past but recently this keyboard shortcut (Ctrl-M) won't
run the macro. Assigning an additional shortcut combo to that macro also is
to no avail.

The macro applies a Style I created to the selected text. If I create a new
macro to handle the formatting the same way (by applying the Style) and then
assign a keyboard shortcut to THAT new macro, the shortcut works. The code
in the problem macro and the new macro are identical.

All other custom keyboard shortcuts work fine.

Any ideas on how to wake up this macro, please?

Thanks,

Artful
 
S

Suzanne S. Barnhill

FWIW, it's not necessary to use a macro to apply a style; keyboard shortcuts
can be assigned to styles directly. Styles are listed in the Customize
Keyboard dialog; what may not be immediately obvious is that you can assign
a shortcut to any style, but only the styles in use are listed there, so you
have to have used the style in your document/template before it will be
available for assignment.
 
A

Artful_Dodger via OfficeKB.com

Thanks. A work around is better than a ream of speculation. It could be
that this is the heart of the problem. An earlier version of my macro did
all the work step by step till I got the idea to make a style that
incorporated the same steps and then have the macro invoke the style.

I can't remember when the new and improved version stopped responding to the
macro but it could well have been from the very beginning of the change.

Yup. Creating a new macro that did it the old way worked fine with the Ctrl-
M shortcut. (I had wondered if that Ctrl-M shortcut was a bad choice, as it
was alternate way of inserting a carriage return under DOS. But that is no
longer the case under Win XP.)

BOTTOM LINE: Trying to use a keyboard shortcut to invoke a macro that merely
applies a Style won't work. Assign a shortcut directly to the Style and
forget the macro altogether.

I very much appreciate your taking the time to help me with this.

Artful
FWIW, it's not necessary to use a macro to apply a style; keyboard shortcuts
can be assigned to styles directly. Styles are listed in the Customize
Keyboard dialog; what may not be immediately obvious is that you can assign
a shortcut to any style, but only the styles in use are listed there, so you
have to have used the style in your document/template before it will be
available for assignment.
I created a macro to format text (indent both side of text for a long
quotation).
[quoted text clipped - 18 lines]
 
S

Suzanne S. Barnhill

The Ctrl+M shortcut by default is assigned to IncreaseIndent (and
Ctrl+Shift+M to UnIndent), so it's not an unreasonable shortcut for your
Block Text style, and assigning it to your macro should have unassigned it
from the built-in command, but it may be that there remained some conflict.
Also, any macro that depends on text being selected might have a problem it
it wasn't: though having the insertion point in a paragraph is sufficient to
apply a style, who knows how this would work with the macro?



Artful_Dodger via OfficeKB.com said:
Thanks. A work around is better than a ream of speculation. It could be
that this is the heart of the problem. An earlier version of my macro did
all the work step by step till I got the idea to make a style that
incorporated the same steps and then have the macro invoke the style.

I can't remember when the new and improved version stopped responding to the
macro but it could well have been from the very beginning of the change.

Yup. Creating a new macro that did it the old way worked fine with the Ctrl-
M shortcut. (I had wondered if that Ctrl-M shortcut was a bad choice, as it
was alternate way of inserting a carriage return under DOS. But that is no
longer the case under Win XP.)

BOTTOM LINE: Trying to use a keyboard shortcut to invoke a macro that merely
applies a Style won't work. Assign a shortcut directly to the Style and
forget the macro altogether.

I very much appreciate your taking the time to help me with this.

Artful
FWIW, it's not necessary to use a macro to apply a style; keyboard shortcuts
can be assigned to styles directly. Styles are listed in the Customize
Keyboard dialog; what may not be immediately obvious is that you can assign
a shortcut to any style, but only the styles in use are listed there, so you
have to have used the style in your document/template before it will be
available for assignment.
I created a macro to format text (indent both side of text for a long
quotation).
[quoted text clipped - 18 lines]
 
A

Artful_Dodger via OfficeKB.com

Thank you.
The Ctrl+M shortcut by default is assigned to IncreaseIndent (and
Ctrl+Shift+M to UnIndent), so it's not an unreasonable shortcut for your
Block Text style, and assigning it to your macro should have unassigned it
from the built-in command, but it may be that there remained some conflict.
Also, any macro that depends on text being selected might have a problem it
it wasn't: though having the insertion point in a paragraph is sufficient to
apply a style, who knows how this would work with the macro?
Thanks. A work around is better than a ream of speculation. It could be
that this is the heart of the problem. An earlier version of my macro did
[quoted text clipped - 29 lines]
 

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