Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Using the Print dialog

Using the Print dialog

Scheduled Pinned Locked Moved Visual Basic
comquestionhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sayan Mukherjee
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • S Sayan Mukherjee

      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

      D Offline
      D Offline
      David Wengier
      wrote on last edited by
      #2

      You need to print the data yourself. Lookup the Printer Object in help. -- David Wengier Sonork ID: 100.14177 - Ch00k

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups