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);
}
-------------------------------------------------------------------------
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);
}
-------------------------------------------------------------------------