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()
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()