Print preview promt to save changes

B

Bob Carsto

I open a publisher document and show the print preview progamatically. When
I click print from the preview, the document closes the preview and displays
in design mode and the Close() following the PrintPreview) function fails.
How can I prevent this.

On top of that, when I manually close the document, I am prompted to save
changes.

Here is a small sample. I am using Publisher 2003 SP1
Dim app As New Microsoft.Office.Interop.Publisher.Application

Dim doc As Microsoft.Office.Interop.Publisher.Document

doc = app.Open("C:\t.pub", True, False,
Microsoft.Office.Interop.Publisher.PbSaveOptions.pbDoNotSaveChanges)

app.PrintPreview = True

Dim i As Long

While (doc.Application.PrintPreview)

i = i + 1

i = i - 1

End While

doc.Close()

app.Quit()
 

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