Thread: [Solved] Confusion about paragraphs
View Single Post
 
Old 04-10-2014, 06:08 AM
Sektor Sektor is offline Windows 8 Office 2013
Novice
 
Join Date: Mar 2014
Location: Russia
Posts: 6
Sektor is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
I suspect the problem you're having is a conceptual one, rather than anything to do with Word's object model.
Yes, Paul, you're actually right. I come from Excel environment, and I have difficulty with switching to Word's realm. I felt this since I first tried to write VBA code in Word.
And yes - the main struggle is paragraphs and all manipulating with them. I would like you to help me with this.
So, when I execute Paragraphs.Add(), I see new paragraph mark which happens to be the last one in document. So, this is my paragraph. It has a Range.Text property which can be assigned some text. What I do not understand, why p.Range.Text deletes this brand new paragraph and, moreover, replaces the text of second paragraph?
Look. Paragraphs(Paragraphs.Count) refers to the same paragraph. Then why p.Range.Text fails to work when Paragraphs(3) works fine? Can you explain me more in detail? Thanks beforehand!
Reply With Quote