Link to home
Start Free TrialLog in
Avatar of Jixin Wei
Jixin Wei

asked on

Can a page break (or section break) be located in the beginning (or middle) of a paragraph (normally in the end)?

I had this question after viewing Recognise Section Breaks in VBA.

Originally, I also wanted to find out how to distinguish between a page break and a section break. And a search as such led me to the above quoted/linked post. My confusion was (basically) resolved after reading the post.

But then I remember something. I remember seeing in different documents, that a section break can be located both in front of and after a paragraph mark!

So I came up with another question: "Can a section break be located in the beginning of a paragraph?" (In other words, immediately following a paragraph mark, i.e., the one of the previous paragraph?)  Before searching, I did some experiments, the results of which can only be described as "bizarre" --

In the original post, all people seemed to assume that a page break or section break is the Second Last character of a paragraph, i.e., the last paragraph of the section. Yet, through my experiments (see attached pictures), while on the one hand it is true that whenever one inserts a page break or section break in the document, Word will automatically add a paragraph mark immediately following that break, however, on the other hand, it *is* possible that afterwards, one deletes (can delete) both the paragraph mark immediately preceding the break and the one immediately following the break! So that the break (either page break or section break) can be located in the MIDDLE of a paragraph, needless to say, it can be in the beginning of a paragraph, too!

Then I checked the true number of paragraphs on both ends of the break (also as shown in attached pictures). And: with a page break, there is only one paragraph; with a section break, there are two paragraphs! It looks the same, but are different! (To think, the two bype of breaks are both the same Chr(12)!) In the latter case, it also means that a paragraph can end without a paragraph mark, but with a section break instead!... Or is that so?

I know the original post is pretty old (posted ten years ago?) but if by any chance people still stumble upon this place, then -- I don't know what the question is any more -- but what do you think?
1.png
2.png
SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jixin Wei
Jixin Wei

ASKER

My apologies. The question was poorly written. Later, I myself had difficulty understanding what I wrote. But, in my defense, besides that I am a beginner, there is also proof that this is a very complicated matter (an advanced subject/topic). Here is the proof: In the Immediate window, I used these two commands (1) Print Selection.Characters.Count; (2) Print Asc(Selection.Characters.Last) to see what the special character, or control character, is. I found these: line break is Chr(11); column break is Chr(14); and page break and section break, as already discussed, are both Chr(12). The column here means the column in page layout (not to be confused with table column). In the Word menu, however, Breaks are divided into Page Breaks and Section Breaks two categories, whereas Column Break is in the Page Breaks category. >>>>> There is a "wdBreakType Enumeration" but, it is used solely in Range. or Selection.InsertBreak method. Therefore, inserting a specific break is easy, but how to find them later? Especially when they have the same ASCII code, i.e., page break equals section break equals Chr(12)?? Perhaps only through additional checking, to see whether the previous character and the next character are of the same section...