How to copy format of the new paragraph

May 14, 2012 at 11:13 AM
Edited May 14, 2012 at 11:41 AM

I opened existing document, changed paragraph text to new and created new paragraph with InsertParagraphAfterSelf. But:

  1. After first paragraph (where is changed text) extra paragraph appeared. <SOLVED - My fault>
  2. Second and other paragraphs format differs from first: different indentation, line spacing.

I tried to copy some format:
newPar.IndentationFirstLine = par.IndentationFirstLine;
But result was very strange - looked that indentation become negative. If I set indentation to constant: 
newPar.IndentationFirstLine = (float)1.5;
indentation become correct.

Is there any way to copy all format of the paragraph and set it to new paragraph?

Why code:

par.RemoveText(0);
par.InsertParagraphAfterSelf(docTextArray[i]);

breaks with exception?