PDA

View Full Version : Emulating WordPerfect's Block Protect



andalusia
06-22-2006, 06:04 PM
I have a group of text that I wish to block together so that it will not leave widows/orphans. I understand that each TypeText command produces a blocked paragraph. However, The block is going to span two and possibly more sections in VBA code, so it is not possible to restrict the text to one TypeText. I found a little bit about Word's paragraph symbols (pilcrows), but haven't discovered how to manipulate them effectively. Thank you for taking the time to read this and I look forward to any responses generated.

J

fumei
06-23-2006, 01:09 AM
Can you describe in more detail precisely what you want to achieve?

You are putting in text by code?
You are splitting the text across Sections? How are you putting in the Section breaks?

What exactly are you meaning by "protect"? I can't remember WordPerfect Block protect - although I do remember that there was such a thing.

andalusia
06-23-2006, 09:14 PM
Sections was the wrong word to use. What I meant is that the text is entered by code in different locations within the macros, so right now I don't see a way to put it all in one TypeText.

I am producing text based on user choices. Occasionally the text spills over onto another page with one line, leaving an orphan. I want to "protect" a reasonable portion of the end text so that it will either all go on the second page or all on the first page.

geekgirlau
06-23-2006, 09:33 PM
Selection.ParagraphFormat.KeepTogether = True


The paragraph doesn't need to be selected when you run this - "KeepTogether" is an attribute of the entire paragraph in which the cursor is sitting.

The other one that you will need to get used to is "KeepWithNext", which forces the current paragraph to stay on the same page as the next paragraph. You can see these options if you select Format | Paragraph | Line and page breaks.

mdmackillop
06-24-2006, 03:37 AM
Keep Together will move the whole paragraph to the next page if it "overspills". To ensure a minimum of two lines on the next page use

Selection.ParagraphFormat.WidowControl = True

fumei
06-25-2006, 01:57 PM
What I meant is that the text is entered by code in different locations within the macros, so right now I don't see a way to put it all in one TypeText.No...you can't put it all in one TypeText. Why would you? Who cares? So you put text in as two instructions of TypeText. Yes...and the problem is?

The suggestions for KeepTogether, WidowControl are best to keep your text together....but I still fail to see what your problem is. You are putting text into two distinct locations, so they are going to be distinct, and not together.

Perhaps if you clearly stated what the problem was, and perhaps even postsed some code...hmmmm?...we could make some concrete suggestions. If your problem is simply:
I want to "protect" a reasonable portion of the end text so that it will either all go on the second page or all on the first page.then the suggested properties will do.