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?
Jixin WeiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

That is interesting research.

A Section break performs the function of terminating a paragraph, but is only allocated a single character space in the range, so the paragraph mark isn't displayed separately.

In the Word Object Model, a document's main range is divided thus: >Sections>Paragraphs>Sentences>Words>Characters. A subsidiary element cannot be spread across more than one of its parent elements, so a section break (even if continuous) inserted into a paragraph will split the paragraph into two separate paragraphs.  There is no Page object in this context, so a single paragraph can spread either side of  a page break whether it is automatic (i.e. page overflow)  or manual (a page break character).
That both a Section and a Page break are rendered as Chr(12), points to the fact that the actual location in the range is merely a sort of spacer and that the relevant properties are stored elsewhere

They are differentiated in Find and Replace (^b and ^m)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jixin WeiAuthor Commented:
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...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.