Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Paragraph-formatting macro clashing with style
I have created keyboard short-cuts for a number of styles, all of them in the
Ctrl + Alt + x format. I have also created a macro to apply Keep With Next to a paragraph, also with a keyboard short-cut in the same format. When I use the KWN short-cut, the style of the paragraph is corrupted by the importation of the indents of one particular (uncommon) style in the template (to the best of my knowledge, not associated with the creation of the macro, i.e. although a relevant document was open at the time, the cursor would not have been in a passage in the offending style). This occurs whether the style was applied using the mouse or the keyboard short-cut but, if I apply KWN using the mouse, the corruption does not occur. |
#2
|
|||
|
|||
Paragraph-formatting macro clashing with style
Hi
First, let's make absolutely sure that KWN is the problem. If you do Format Paragraph and tick Keep With Next, do you get the same problems? If there are no problems there, we know it's either the keyboard shortcut or the macro. Next, let's make absolutely sure that the keyboard shortcut is running the macro. Do Tools Macro Macros. Find your macro and click Run. Do you get the same problems? If so, post back and paste the code of the macro (everything from Sub to End Sub) in your message. Hope this helps. Shauna Kelly. Microsoft MVP. http://www.shaunakelly.com/word "Style-tamer" wrote in message ... I have created keyboard short-cuts for a number of styles, all of them in the Ctrl + Alt + x format. I have also created a macro to apply Keep With Next to a paragraph, also with a keyboard short-cut in the same format. When I use the KWN short-cut, the style of the paragraph is corrupted by the importation of the indents of one particular (uncommon) style in the template (to the best of my knowledge, not associated with the creation of the macro, i.e. although a relevant document was open at the time, the cursor would not have been in a passage in the offending style). This occurs whether the style was applied using the mouse or the keyboard short-cut but, if I apply KWN using the mouse, the corruption does not occur. |
#3
|
|||
|
|||
Paragraph-formatting macro clashing with style
The problem with macros recording paragraph formatting is that they record
*everything* in the Format Paragraph dialog, which is doubtless the problem with your macro. Fortunately, however, no macro is required to apply the Keep with Next formatting. In the Customize dialog, click on Keyboard and select All Commands. Locate the ParaKeepWithNext command and assign your keyboard shortcut. You can also drag this command (from the Commands tab) to a toolbar if desired (that's what I have done). For more on the shortcomings of recorded macros (and how to get around them), see http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Style-tamer" wrote in message ... I have created keyboard short-cuts for a number of styles, all of them in the Ctrl + Alt + x format. I have also created a macro to apply Keep With Next to a paragraph, also with a keyboard short-cut in the same format. When I use the KWN short-cut, the style of the paragraph is corrupted by the importation of the indents of one particular (uncommon) style in the template (to the best of my knowledge, not associated with the creation of the macro, i.e. although a relevant document was open at the time, the cursor would not have been in a passage in the offending style). This occurs whether the style was applied using the mouse or the keyboard short-cut but, if I apply KWN using the mouse, the corruption does not occur. |
#4
|
|||
|
|||
Paragraph-formatting macro clashing with style
Thank you, Shauna, for these comments. While they are partly superseded by
Suzanne's post, I include the interlined comments below (in caps) 'in the interests of science'. More follows in my reply to Suzanne's post. "Shauna Kelly" wrote: Hi First, let's make absolutely sure that KWN is the problem. If you do Format Paragraph and tick Keep With Next, do you get the same problems? NO If there are no problems there, we know it's either the keyboard shortcut or the macro. Next, let's make absolutely sure that the keyboard shortcut is running the macro. Do Tools Macro Macros. Find your macro and click Run. Do you get the same problems? YES If so, post back and paste the code of the macro (everything from Sub to End Sub) in your message. AS SUZANNE'S POST INDICATES, THE CODE HAS INDEED PICKED UP SOME UNWANTED PARAGRAPH-FORMATTING INFORMATION FROM THE DIALOGUE BOX. HOWEVER, I CAN'T FIGURE OUT HOW TO PASTE IT INTO THIS MESSAGE! Hope this helps. Shauna Kelly. Microsoft MVP. http://www.shaunakelly.com/word "Style-tamer" wrote in message ... I have created keyboard short-cuts for a number of styles, all of them in the Ctrl + Alt + x format. I have also created a macro to apply Keep With Next to a paragraph, also with a keyboard short-cut in the same format. When I use the KWN short-cut, the style of the paragraph is corrupted by the importation of the indents of one particular (uncommon) style in the template (to the best of my knowledge, not associated with the creation of the macro, i.e. although a relevant document was open at the time, the cursor would not have been in a passage in the offending style). This occurs whether the style was applied using the mouse or the keyboard short-cut but, if I apply KWN using the mouse, the corruption does not occur. |
#5
|
|||
|
|||
Paragraph-formatting macro clashing with style
As indicated in my reply to Shauna, your diagnosis seems to be correct. I
seized upon your suggestion below with glee. I deleted the macro and then applied the short-cut in the manner suggested. Wonderful! "Suzanne S. Barnhill" wrote: The problem with macros recording paragraph formatting is that they record *everything* in the Format Paragraph dialog, which is doubtless the problem with your macro. Fortunately, however, no macro is required to apply the Keep with Next formatting. In the Customize dialog, click on Keyboard and select All Commands. Locate the ParaKeepWithNext command and assign your keyboard shortcut. You can also drag this command (from the Commands tab) to a toolbar if desired (that's what I have done). For more on the shortcomings of recorded macros (and how to get around them), see http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Style-tamer" wrote in message ... I have created keyboard short-cuts for a number of styles, all of them in the Ctrl + Alt + x format. I have also created a macro to apply Keep With Next to a paragraph, also with a keyboard short-cut in the same format. When I use the KWN short-cut, the style of the paragraph is corrupted by the importation of the indents of one particular (uncommon) style in the template (to the best of my knowledge, not associated with the creation of the macro, i.e. although a relevant document was open at the time, the cursor would not have been in a passage in the offending style). This occurs whether the style was applied using the mouse or the keyboard short-cut but, if I apply KWN using the mouse, the corruption does not occur. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
styles morphed into "default paragraph font para char" | Microsoft Word Help | |||
Formatting with Styles | Microsoft Word Help | |||
Word 2003: Can one disable table styles? | Tables | |||
Font properties of table styles versus paragraph styles | Tables | |||
Apply Style but keep direct formatting? | New Users |