Insert Picture at a specified location?

Apr 14, 2011 at 2:11 PM

Is there a way to insert a picture into the middle of a paragraph?  I only see InsertPicture() and AppendPicture() and neither appear to allow you to insert the picture at a specified location.

Coordinator
Apr 16, 2011 at 2:04 PM

The second parameter to InsertPicture is the character index to insert at.

Below are three examples

// Insert at half way
paragraph.InsertPicture(picture, p.Text.Length / 2);

// Insert at character index 5
paragraph.InsertPicture(picture, 5);

// Insert just before the first instance of "some text
paragraph.InsertPicture(picture, paragraph.FindAll("some text")[0]);