Free Support Forum - aspose.com

Show PrintDialog after PrintPreviewDialog

Hi Aspose Team!
I’m using Aspose.Word to print some .doc Document. But I want to show PrintDialog after show PrintPreviewDialog.

Friend Class ActivePrintPreviewDialog
Inherits PrintPreviewDialog
‘’’


‘’’ Brings the Print Preview dialog on top when it is initially displayed.
‘’’

Protected Overrides Sub OnShown(ByVal e As EventArgs)
Activate()
MyBase.OnShown(e)
End Sub
End Class

What overridable sub I can overrides make that when I click Print button in PrintPreviewDialog, I’ll call PritDialog?

Thanks for your help.
-------------
tqnga

Hi Tqnga,


Please accept my apologies for late response. Thanks for your inquiry. We are working over your query and will update you asap.

Hi Tqnga,


Thanks for your patience. Please use the following code snippet to achieve your requirements. I have attached the PrintPreviewTest class with this post. Hope this helps you. Please let us know if you have any more queries.

<span lang=“EN-GB” style=“font-size:10.0pt;font-family:“Courier New”;mso-font-kerning:0pt;
mso-no-proof:yes”> Dim doc As New Document(“input.doc”)<o:p></o:p>

Dim previewDlg As New PrintPreviewTest()

Dim awPrintDoc As New Aspose.Words.Rendering.AsposeWordsPrintDocument(doc)

' Pass the Aspose.Words print document to the Print Preview dialog.

previewDlg.Document = awPrintDoc

' Specify additional parameters of the Print Preview dialog.

previewDlg.ShowInTaskbar = True

previewDlg.MinimizeBox = True

previewDlg.PrintPreviewControl.Zoom = 1

previewDlg.Document.DocumentName = "TestName.doc"

previewDlg.WindowState = FormWindowState.Maximized

' Show the appropriately configured Print Preview dialog.

previewDlg.ShowDialog()