This project has moved. For the latest updates, please go here.

Replace text by image or image by another image

Dec 6, 2012 at 2:11 PM

I have an docx template and I want put an image where my tag <image_here> is.

The tag is inside a Text Box, and this textbox layout is formated Front Of Text, because I have another image (like background) formated with Behind Text format.

What I do is:

  1. search for paragrah where is the tag
  2. in that paragraph I Append my picture: document.AppendPicture(pic1);
  3. and replace my tag for empty: document.ReplaceText("<image_here>", "");
  4. Save the document

It's ok, the image is there but is not where the tag was, is after the paragraph.

How can I fix it?

 

Should I create a new Paragraph and set the "position" of that paragraph? (how I do it?)

Should I use an image instead string tag and replace image? (I don't know do it)

Is the problem put the tag <image_here> here inside Text Box?

Thanks.