Re: A recorded macros to assign style "Normal" doesn't work
- From: "Jay Freedman" <jay.freedman@xxxxxxxxxxx>
- Date: Tue, 22 May 2007 13:45:57 -0400
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.
Jay Freedman wrote:
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.
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
.
- References:
- 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: A recorded macros to assign style "Normal" doesn't work
- Next by Date: Re: Connect mysql with vba
- Previous by thread: Re: A recorded macros to assign style "Normal" doesn't work
- Index(es):