Help invoking Visio's Print Preview from C#

B

Brian

Hi!

We have a .NET 2.0 WinForms Smart Client app built on Office System 2003.
In particular, we generate our diagrams in Visio 2003, which we embed inside
some of our WinForms.

One of the advantages of using Visio is that we can use the fancy multi-page
print capability.
We are close to getting the settings we wanted and invoking Visio's printing
functionality...

We can set some initial values for the page setup.
We can bring up the Visio PageSetup Dialog.
We can fire off a Print based on the current settings.

We have NOT been able to invoke the PrintPreview mode.
According to the SDK documentation we should be able to call:

Application.DoCmd(visCmdPrintPreview)

That enumeration is 1490.
But all we ever get back is an error dialog:

Requested operation is presently disabled.

Is this functionality not available in embedded mode?
It's listed as being available for Automation. Does that only mean from
VBA???

We have googled and found nothing.

Any advice greatly appreciated.
Thanks,

Brian
 
J

JuneTheSecond

maybe, maybe, the type of window ocasionary not drawing.
My idea is to check the type of window before entering
print preview.

If ActiveWindow.Type = visDrawing Then
Application.DoCmd (visCmdPrintPreview)
Else
MsgBox "Window type is not drawing."
End If
 
B

Brian

Thanks for the suggestion, June.
We dropped in that code... the if-condition is true...
but the DoCmd still doesn't invoke the Print Preview.
If we instead have DoCmd bring up the pan window,
hide the stencil windows, invoke Page Setup, etc...
they all work. Just Print Preview won't.

= frustrated =
 

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