A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Visio
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

saving preview picture



 
 
Thread Tools Display Modes
  #1  
Old July 12th, 2008, 07:27 PM posted to microsoft.public.visio.general
JB
external usenet poster
 
Posts: 290
Default saving preview picture

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.
--
JB
  #2  
Old July 13th, 2008, 07:14 PM posted to microsoft.public.visio.general
David Parker
external usenet poster
 
Posts: 467
Default saving preview picture

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.

"JB" wrote in message
...
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.
--
JB


--
David Parker
Microsoft MVP (Visio)
http://bvisual.spaces.live.com
http://www.visualizinginformation.com

  #3  
Old July 13th, 2008, 09:20 PM posted to microsoft.public.visio.general
JB
external usenet poster
 
Posts: 290
Default saving preview picture

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?
--
JB


"David Parker" wrote:

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.

"JB" wrote in message
...
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.
--
JB


--
David Parker
Microsoft MVP (Visio)
http://bvisual.spaces.live.com
http://www.visualizinginformation.com


  #4  
Old July 13th, 2008, 11:48 PM posted to microsoft.public.visio.general
WapperDude
external usenet poster
 
Posts: 589
Default saving preview picture

The Save Preview picture just uses the 1st page.

Wapperdude



"JB" wrote:

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?
--
JB


"David Parker" wrote:

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.

"JB" wrote in message
...
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.
--
JB


--
David Parker
Microsoft MVP (Visio)
http://bvisual.spaces.live.com
http://www.visualizinginformation.com


  #5  
Old July 14th, 2008, 07:16 PM posted to microsoft.public.visio.general
JB
external usenet poster
 
Posts: 290
Default saving preview picture

Thanks for that.
--
JB


"WapperDude" wrote:

The Save Preview picture just uses the 1st page.

Wapperdude



"JB" wrote:

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?
--
JB


"David Parker" wrote:

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.

"JB" wrote in message
...
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.
--
JB

--
David Parker
Microsoft MVP (Visio)
http://bvisual.spaces.live.com
http://www.visualizinginformation.com


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:58 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.