saving preview picture

J

JB

I am developing an app that uses automation to launch Visio and then stores
the saved data in a database. This involves COM, OleCreate, storage files,
etc. Along with saving the complete document data, I also want to save the
preview pictures separately for use in a drawing selection list. Looking at
the Visio object model, I find a reference to the PreviewPicture property of
the document object but this is only available for in-proc processes which is
not the case here. What happens is that if I QI for IDispatch* on the
document and then do a propertyget for "PreviewPicture", I get back a null
interface. How do I go about accessing the preview picture and saving it to
a file?

Even if I manage to get IPictureDisp, that still doesn't solve the problem
of saving to a file because IPictureDisp unlike IPicture does not have the
SaveToFile method.
 
D

David Parker

You may wish to look at the Page.Export() method, as you can use this to
create image files for all the pages you want to.
 
J

JB

Thanks for the reply. I happened on to the Page-Export method after posting
my question and I have gotten it to work using that. However, that leaves me
with a couple more questions. First is efficiency. Since Visio has already
created the preview pic as a result of the call to OleSave, it would seem
that extra work is being done to create the pic again when the Export method
is called.

The second question is the relationhship between the Preview pic and the
result of the export. Is the Preview pic always based on Page-1 or is there
some merge going on when multiple pages are present?
 

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