A recorded macros to assign style "Normal" doesn't work

L

Larry Root

I have created new style "Case Cite" as applying Italics.

I recorded two new macros to apply "Case Cite" and "Emphasis" to selected
text; both macros select styles from the tool-bar, type in the style name,
and end with "Enter." I created new macro buttons for each. They all work
as expected.

I then wanted to be able to return text that I'd styled as "Case Cite" or
"Emphasis" to "Normal" text. I recorded a similar macro to reapply "Normal"
to the styled text. But this recorded macro results in the text being styled
"Case Cite + Normal" or Emphasis + Normal" rather than merely "Normal." When
I enter the same routine manually, it generates the expected "Normal" style.

I would sincerely appreciate any suggestions or explanations.

Very respectfully,
Larry
 
J

Jay Freedman

First, a direct answer to your question: The code to remove all applied
style and direct formatting from the selected text is

Selection.ClearFormatting

Second, you don't need any macros for what you're doing. You can assign any
style (or any other built-in command) directly to a button or shortcut key.
Follow the directions in
http://www.word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm or
http://www.word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToHotkey.htm and
choose the "Style" category in the Customize dialog.

Also, by default the ClearFormatting command is assigned to the shortcut
Ctrl+spacebar.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Jay Freedman

Oops, that should be Ctrl+Q rather than Ctrl+spacebar.

- Ctrl+Q is assigned to the ResetPara command, which sets the paragraph back
to its default font formatting.

- Ctrl+spacebar is assigned to the ResetChar command, which is similar but
resets character formatting rather than paragraph formatting.
 
L

Larry Root

Jay,

Thank you! I've printed that out and will try its approach.

VERY respectfully,
Larry
 

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