Page 1 of 1

Exporting TSheet Pictures

Posted: Fri Jan 09, 2009 2:00 pm
by billegge
I am building an Excel to PDF converter for use in my company and I have an excel file with a company logo in it. I need to export this picture to a file so I can then embed it into the pdf.

My problem is that I cannot associate the Picture in the sheet with a picture in MSOPictures. Sheet.DrawingObjects.Pictures.Items[0].PictureName has the name of the file without the extenstion, but MSOPictures.Items[0].Filename is blank. So I don't know how to associate them.

Re: Exporting TSheet Pictures

Posted: Fri Jan 09, 2009 3:17 pm
by billegge
After doing some research, it seems that the PictureID of Sheet.DrawingObjects.Pictures.Items[x] relates to the index into MSOPictures as

PicID:= Sheet.DrawingObjects.Pictures.Items[x].PictureID;
MSOPicIndex:= PicID-1;
ThePicture:= XLS.MSOPictures.Items[MSOPicIndex];

Is this correct?