Setting the size of Inserted images

A

Andrew Mercer

Hi,

I am using the followng code to insert an image into a Word document.

object oBookmarkName = "Image_bookmark";
object Range =
(object)oWordApp.ActiveDocument.Bookmarks.get_Item(ref oBookmarkName).Range;
oWordApp.ActiveDocument.InlineShapes.AddPicture
("My_Image", ref LinkToFile,
ref SaveWithDocument, ref Range);

However I am trying to set the width and height but the following
suggestions I have found both fail.
//oWordApp.ActiveDocument.InlineShapes(1).Width = 200;
//oWordApp.ActiveDocument.InlineShapes.Item(1).Height = 100;

I think at least one of these is VB?
Can anyone advise the correct C# code.

Thanks for any help in advance.

Regards Andrew
 

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