Inserting and resizing a image into Word using C#

F

Fabio Barreiro

Hi!

I can't get to insert an image into Microsoft Word and resize it. In fact,
the picture is inserted, but can't resize it after that. The image is beeing
inserted into a table. I don't know if that makes any difference. here's the
code

public void InserirImagemTabela(int pIdTable, int pRow, int pCol, string
pPathImage)
{
Word.Cell cell = oDoc.Tables[pIdTable].Cell(pRow, pCol);
object oGuardarImagemNoDoc = true;
Word.InlineShape ils = cell.Range.InlineShapes.AddPicture(pPathImage, ref
oMissing, ref oGuardarImagemNoDoc, ref oMissing);

ils.LockAspectRatio = Microsoft.Office.Core.MsoTriState.msoTrue;
ils.ScaleHeight = 200.0F;
ils.ScaleWidth = 300.0F;
}

any help?
 
Joined
May 7, 2013
Messages
1
Reaction score
0
Why don't you resize the image before you insert it into Microsof Word? i believe this can be a easier way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top