Reply
 
Thread Tools Display Modes
  #1   Report Post  
Style-tamer
 
Posts: n/a
Default 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   Report Post  
Shauna Kelly
 
Posts: n/a
Default 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   Report Post  
Suzanne S. Barnhill
 
Posts: n/a
Default 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   Report Post  
Style-tamer
 
Posts: n/a
Default 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   Report Post  
Style-tamer
 
Posts: n/a
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
styles morphed into "default paragraph font para char" Sandra Salstrom Microsoft Word Help 8 April 4th 07 01:02 PM
Formatting with Styles Jackie D Microsoft Word Help 13 July 27th 05 05:35 PM
Word 2003: Can one disable table styles? [email protected] Tables 5 April 10th 05 10:02 AM
Font properties of table styles versus paragraph styles Bob S Tables 3 February 8th 05 01:13 PM
Apply Style but keep direct formatting? Stefan Blom New Users 2 November 28th 04 11:30 PM


All times are GMT +1. The time now is 02:44 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"