Graphics filter was unable to convert this file

C

CK

Hi all, I encounter this error quite frequently when programmatically
inserting the picture into WORD.

FYI, the application will resize the image when inserting it. Also, I am
using Office XP SP3.

I have done some searching and understood that Microsoft claims to have
solved this error in SP3. But still, not for my case.

Does any1 know how can I resolve this problem? All helps are deeply
appreciated.

Below is my code snippet. Thanks.
--------------------------------------------------
WORDRANGE = WORDDOC.Bookmarks.get_Item(ref targetBookmark).Range;
MSWORD.InlineShape inShape = WORDRANGE.InlineShapes.AddPictur (picturePath,
ref ObjMissing, ref ObjMissing, ref ObjMissing);

if (inShape.Width > WORDAPP.MillimetersToPoints((float)picWidth))
{
inShape.Width = WORDAPP.MillimetersToPoints((float)picWidth);
}

if (inShape.Height > WORDAPP.MillimetersToPoints((float)picHeight))
{
inShape.Height = WORDAPP.MillimetersToPoints((float)picHeight);
}
-------------------------------------------------------------------------
 

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