Results 1 to 1 of 1
Thread: Code: Sub cmd_KeepWithNext()
2001-04-06, 11:21 #1
- Join Date
- Feb 2001
- Yilgarn region of Toronto, Ontario
- Thanked 0 Times in 0 Posts
Code: Sub cmd_KeepWithNext()
For some reason it seems to make sense to be able to run a macro on a set of paragraphs rather than go through the menu system (Format, Paragraphs, LinePageBreaks, KeepWithnext) and how many times do I toggle that switch right past the solid tick and have to go around again?
Bearing in mind the recent discussion on endless-repagination, I should maybe test that the selected text can fit on one page?
<pre>Public Sub cmd_KeepWithNext()
' Procedure : cmd_KeepWithNext
' Description: For the selected paragraphs, keep with next all but last one.
' Copyright: Chris Greaves Inc.
' Inputs: None.
' Returns: None
' Assumes: Nothing
' Side Effects: None.
' Tested: By a call from the user.
' Handy when you have groups of paragraphs that must stay on the same page.
' Select all the paragraphs, run the macro.
Dim i As Integer
For i = 1 To Selection.Paragraphs.Count - 1
Selection.Range.Paragraphs(i).KeepWithNext = True