Hi everyone,
maybe I am overlooking something very obvious... but, as the topic suggests I have a problem with paragraphs that appear to both exist and not to exist at the same time.
The problem occurs always when when there is an empty paragraph at the end of a content control. I am looking for a way to target this paragraph efficiently and remove it.
My problem is mainly that I cannot find a way to target these paragraphs directly for whatever reason!
I've built a small example to demonstrate my problem:
Lets say I have a content control cc in that one can select three paragraphs (screenshot) of which the last one is empty. The test document looks like this:

It has 6 paragraphs in total of which 2 are placed before the content control, three are or lets say should be within the cc and one is/should be after the cc. The cc is a rich text cc, if that matters.
When I run the code
Code:
Sub countParasInCC()
Dim doc As Document, cc As ContentControl, ccRange As Range, paraCountCC As Integer, myccTitle As String
Set doc = ActiveDocument
myccTitle = "ccTitle"
Set cc = doc.SelectContentControlsByTitle(myccTitle).Item(1)
Set ccRange = cc.Range
paraCountCC = ccRange.Paragraphs.Count
End Sub
the result is paraCountCC = 2.
However, when i run the code
Code:
Sub countParasDocument()
Dim doc As Document, paraCountDoc As Integer
Set doc = ActiveDocument
paraCountDoc = doc.Range.Paragraphs.Count
End Sub
I get paraCountDoc = 6.
Can somebody explain to me why the empty paragraph is not counted when counting paragraphs in the cc's range but is counted when counting paragraphs in the document range? What is the method to target and remove such paragraphs?
Many thanks in advance!