Microsoft Office Document Imaging Issue

Hello,

I am writing a little program using the MODI (Microsoft Office Document Imaging) and trying to save some pictures created by the Microsoft Office Document Image Writer.

I manage to save a thumbnail of each page in the MDI file but not the full picture: "element not found" is raised when trying to reach the full picture's handle.

Here is the little code portion:

Dim myMODIDoc As New MODI.Document
Dim j As Integer
Dim myImage As Image
Dim myPicture1 As stdole.IPictureDisp
Dim myPicture2 As stdole.IPictureDisp

myMODIDoc.Create("c:\power.mdi")

For j = 0 To myMODIDoc.Images.Count - 1
Dim myMODIImage As MODI.IImage = myMODIDoc.Images.Item(j)

'save the Thumbnail: It works
myPicture1 = myMODIImage.Thumbnail
myImage = Image.FromHbitmap(New System.IntPtr(myPicture1.Handle))
myImage.Save("c:\imgThumbnail" & j & ".jpg")

'save the full image
myPicture2 = myMODIImage.Picture
'FAILS!!!!!!!!!!! => element not found
myImage = Image.FromHbitmap(New System.IntPtr(myPicture2.Handle))
myImage.Save("c:\imgFull" & j & ".jpg")
Next

Is there a workaround or a fix for this?

Thanks.
Stphane.

[1517 byte] By [StephaneS] at [2008-1-28]
# 1
Hi,

One little info: in a similar program in VB6, the two pictures are reachable (full and thumbnail picture)...

But how to do this in .Net?

Stphane.

StephaneS at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...
# 2
Hi Stephane:

The best place to receive an answer to this question is on the microsoft.public.office.developer.active.documents newsgroup.

Thanks!

Mike Hernandez
Community Program Manager
VSTO Team

MikeHernandez-MSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Tools for Office,Visual Studio Tools for Office...