A family of Microsoft word processing software products for creating web, email, and print documents.
Perhaps this?
Sub ToggleKeepWithNext()
With Selection.Paragraphs(1)
.KeepWithNext = Not .KeepWithNext
End With
End Sub
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm hoping someone can help me with a Keep With Next macro. I don't see that it's listed in any of the options in the command buttons selections so I'm looking to add it programatiacally with a Macro which I'll put on one of the toolbars. Does anyone have something like this? I'd like it to simply toggle the selected paragraph.
We use it quite often and going to Format/Paragraph/Line and Page Breaks Tab/select or deselect Keep with Next option is a lot of work. Clicking a button makes WAY more sense.
Can someone help me out with a macro for this please?
I thank you for your help in advance!
~Dax
A family of Microsoft word processing software products for creating web, email, and print documents.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Perhaps this?
Sub ToggleKeepWithNext()
With Selection.Paragraphs(1)
.KeepWithNext = Not .KeepWithNext
End With
End Sub
Not only can you assign a keyboard shortcut to ParaKeepWithNext, you can assign it to a toolbar button. For a nice-looking button icon, see http://sbarnhill.mvps.org/WordFAQs/CustomToolbar.htm. The button has the added advantage that when you click in a document, the on/off status of the button shows whether the property has been applied to the paragraph at the insertion point.
YES!!! That rocks! Thank you!!!! ~Dax
Even easier, how about attaching the command to a shortcut? It is the format command ParaKeepWithNext.
Tools > Customize > Keyboard
One other method would be a Style with the setting for the following Style reverting to the original Style.