Using the Print dialog
-
Hi, I require some application data to be printed from my VB application. I intend to use the standard Print dialog (that is generally available in all MS applications) for this. Using the ActiveX control CommonDialog I am able to pop up the dialog with the desired settings (that is page from, page to, orientation, number of copies etc). But how do I pass the desired data to the dialog so that it can print it? I could not find any method that accepts the data. When I click the button [PRINT], nothing is printed. Please help! Thanks in advance. I am placing a section of the code below: =============================================================== 'cmd1 is an instance of the ActiveX control 'created by including Microsoft Common Dialog 6.0 'in the Controls dialog box under the Project menu cmd1.DialogTitle = "Print text file from VB" cmd1.Copies = 1 cmd1.FromPage = 1 cmd1.ToPage = 2 cmd1.FileName = "c:\abcd.txt" 'This is the file I want to print cmd1.Orientation = cdlLandscape cmd1.ShowPrinter 'Popup the standard print dialog =============================================================== Is there any other way of doing this? With best regards, Sayan Email:sayanmukherjee@indiatimes.com
-
Hi, I require some application data to be printed from my VB application. I intend to use the standard Print dialog (that is generally available in all MS applications) for this. Using the ActiveX control CommonDialog I am able to pop up the dialog with the desired settings (that is page from, page to, orientation, number of copies etc). But how do I pass the desired data to the dialog so that it can print it? I could not find any method that accepts the data. When I click the button [PRINT], nothing is printed. Please help! Thanks in advance. I am placing a section of the code below: =============================================================== 'cmd1 is an instance of the ActiveX control 'created by including Microsoft Common Dialog 6.0 'in the Controls dialog box under the Project menu cmd1.DialogTitle = "Print text file from VB" cmd1.Copies = 1 cmd1.FromPage = 1 cmd1.ToPage = 2 cmd1.FileName = "c:\abcd.txt" 'This is the file I want to print cmd1.Orientation = cdlLandscape cmd1.ShowPrinter 'Popup the standard print dialog =============================================================== Is there any other way of doing this? With best regards, Sayan Email:sayanmukherjee@indiatimes.com
You need to print the data yourself. Lookup the Printer Object in help. -- David Wengier Sonork ID: 100.14177 - Ch00k