View Single Post
 
Old 04-08-2019, 07:19 AM
WADEVCAMP WADEVCAMP is offline Windows 10 Office 2016
Novice
 
Join Date: Apr 2019
Posts: 1
WADEVCAMP is on a distinguished road
Default Why does paragraph inherit style of the following paragraph?

I have VBA code that has the following line of code:

Code:
SRCdoc.Paragraphs(iPara).Range.Text = _
    Replace(SRCdoc.Paragraphs(iPara).Range.Text, ",", " ", 1, , vbTextCompare)
My question is why this line of code causes the paragraph to inherit the style of the FOLLOWING paragraph.

The particular case I am currently investigating is one in which there are no commas in the paragraph, so the REPLACE statement should not change the paragraph, yet, it always inherits the style of the subsequent paragraph. This happens when the following paragraph is a custom style and when it is the default 'normal' style.

Help would be much appreciated.
Reply With Quote