Hi,
I'm trying to add paragraphs to a TextFrame and want to keep the original formatting. I saw in various posts, that you achieve this by cloning the first portion of the first paragraph.
I have following code:
paragraphIndex++;
m_textFrame.Paragraphs.Insert(paragraphIndex, new Paragraph(m_textFrame.Paragraphs[0]));
m_textFrame.Paragraphs[paragraphIndex].Portions.Clear();
m_textFrame.Paragraphs[paragraphIndex].Portions.Add(new Portion(m_textFrame.Paragraphs[0].Portions[0]));
m_textFrame.Paragraphs[paragraphIndex].Portions[0].Text = "blah!";
But it's not retaining the formatting (I get one paragraph nicely formatted followed by all others unformatted) accross paragraphs. It does work if I only have one paragraph and clone its portions.
Is there something wrong with the code or do you know of another way of storing formatting info?
Thanks for your help,
Dominic