Well, it seems to me you need to do three things:
1) Determine how to set a page break. I never use them, myself—all the tools I create are for use on the PC—so I guess you'd have to use the macro recorder to figure out how this works.
2) Have your program count lines from the top of the "page". When it's time to set a page break, do so (see above) and start the count over from that point.
3) But as to the decision about where to set the break—which I imagine is the real crux of your question—it depends: Do you want to assume that every group is six lines long, or do you want to go to the extra trouble of counting each group as you encounter it and decide whether each group can fit on the current page? The latter is more complicated but more satisfying to the self-approval :-), a heady but dangerous draught.
Which would you rather do? On your choice depends the logic that must follow.
|