PDA

View Full Version : Line feeding last line of paragraph on a doc into next page



sandam
03-31-2005, 02:54 AM
Is it possible to link two paragraphs so that If the second paragraph is pushed on a second page, the trailing line of the preceding paragraph is also pushed on to the same page, but only that one line?

Eg.
page one
---------------------------------------------------------
ParaOneJUNKParaOneJUNKParaOneJUNKParaOneJUNK
ParaOneJUNKParaOneJUNKParaOneJUNKParaOneJUNK

ParaTwoJUNKParaTwoJUNKParaTwoJUNKParaTwoJUNK
ParaTwoJUNKParaTwoJUNKParaTwoJUNKParaTwoJUNK

then becomes

page one
----------------------------------------------------------
ParaOneJUNKParaOneJUNKParaOneJUNKParaOneJUNK

page two
----------------------------------------------------------
ParaOneJUNKParaOneJUNKParaOneJUNKParaOneJUNK

ParaTwoJUNKParaTwoJUNKParaTwoJUNKParaTwoJUNK
ParaTwoJUNKParaTwoJUNKParaTwoJUNKParaTwoJUNK

Hope this all makes sense??

Andrew;?:banghead:

Killian
03-31-2005, 04:34 AM
hmmmm, yes I just remebered how much I hate programming in Word...
I've sort of worked somthing out for working out which para is where. I'll have to leave the rest to you for now (real work arriving...bah!)
Sub test()

'Dim objParagraph As Paragraph
Dim i As Long
Dim iCurrent As Long
Dim iPrev As Long

For i = 1 To ActiveDocument.Paragraphs.Count
iCurrent = ActiveDocument.Paragraphs(i).Range.Information(wdActiveEndAdjustedPageNumbe r)
If i > 1 Then
iPrev = ActiveDocument.Paragraphs(i - 1).Range.Information(wdActiveEndAdjustedPageNumber)
End If
If iCurrent = iPrev + 1 And iPrev <> 0 Then
MsgBox iCurrent & ":" & iPrev
'search ActiveDocument.Paragraphs(i - 1) for the second "." from the end
'grab from that char pos to end of para and move... some how
End If
Next

End Sub

sandam
03-31-2005, 05:10 AM
thanks killian. i'll give it a bash - looks promising, maybe i can keep a bookmark in the template somwhere as a place holder for something - right useful those bookmarks. I'm only just starting to wrap my head around them.

EricFletcher
04-01-2005, 11:25 AM
Whatever approach you use, don't forget to turn off widow/orphan control in the paragraph formatting. When on, Word will try to avoid exactly what you want: the last line of a paragraph (a widow line) shuld not normally be allowed to be by itself at the top of a page. (The orphan line is the opposite: a first line of a paragraph should not normally be allowed to be by itself at the bottom of a page.) Both are typesetting conventions.

fumei
04-08-2005, 01:11 PM
OK, this COULD be done, but I do not see how you can do it without inserting a page break into the previous paragraph. As in:

araOneJUNKParaOneJUNKParaOneJUNKParaOneJUNK
ParaOneJUNKParaOneJUNKParaOneJUNKParaOneJUNK

ParaTwoJUNKParaTwoJUNKParaTwoJUNKParaTwoJUNK
ParaTwoJUNKParaTwoJUNKParaTwoJUNKParaTwoJUNK

then becomes

page one
----------------------------------------------------------
ParaOneJUNKParaOneJUNKParaOneJUNKParaOneJUNK
PageBreak!!!!
page two
----------------------------------------------------------
ParaOneJUNKParaOneJUNKParaOneJUNKParaOneJUNK

ParaTwoJUNKParaTwoJUNKParaTwoJUNKParaTwoJUNK
ParaTwoJUNKParaTwoJUNKParaTwoJUNKParaTwoJUNK

This can be done. A little weird, but possible. The problem is....you now have a page break. The consequences may not be what you want. What if more text is place into page one? It would push a bit into a next page, but the PageBreak would remain, and you would have a gap.

Could you explain the requirement for doing this?