Re: A recorded macros to assign style "Normal" doesn't work
- From: "Jay Freedman" <jay.freedman@xxxxxxxxxxx>
- Date: Tue, 22 May 2007 13:34:06 -0400
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 FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
Larry Root wrote:
Ooops. I'm using Word 2002 SP3.
"Larry Root" wrote:
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
.
- Follow-Ups:
- Re: A recorded macros to assign style "Normal" doesn't work
- From: Jay Freedman
- Re: A recorded macros to assign style "Normal" doesn't work
- Prev by Date: Re: Creating Link in table of contents to specific pages???
- Next by Date: Re: A recorded macros to assign style "Normal" doesn't work
- Previous by thread: Re: Creating Link in table of contents to specific pages???
- Next by thread: Re: A recorded macros to assign style "Normal" doesn't work
- Index(es):