?
Solved

how can I use the printer options

Posted on 2003-02-28
3
Medium Priority
?
146 Views
Last Modified: 2011-10-03
I would like to know how can I use the printer options.

I'm using this on a commnad:

   richtextbox1.SelPrint (Printer.hDC)

This works only with the default printer and shows nothing to the user.
I have a big book on Visual Basic but it says nothing there about the commondialog printer.

Anyone who can tell me how do I use these options (printer, printer options, color, etc).
Thank You
0
Comment
Question by:igfp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Expert Comment

by:Monk246753
ID: 8040662
The ComondialogControlName.ShowPrinter

e.g.
CommonDialog1.ShowPrinter

will bring up the Windows default printer window can choose copies, colors, printers etc. There are a number of other flags to be set for different options but these can be easily found in the MSDN library.
0
 
LVL 3

Accepted Solution

by:
cmgarnett earned 100 total points
ID: 8040743
If you have a form with a RichTextBox, a CommonDialogBox and a CommandButton on it, this code allows you to print the contents of the RichTextBox to whichever printer you want.

Private Sub Command1_Click()
   
   CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
   If RichTextBox1.SelLength = 0 Then
      CommonDialog1.Flags = CommonDialog1.Flags + cdlPDAllPages
   Else
      CommonDialog1.Flags = CommonDialog1.Flags + cdlPDSelection
   End If
   CommonDialog1.ShowPrinter
   RichTextBox1.SelPrint CommonDialog1.hDC

End Sub
0
 

Author Comment

by:igfp
ID: 8041020
Perfect! :) Thank you a lot! Exactly what I wanted to know!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month12 days, 10 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question