[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Print Envelope

Posted on 2009-07-02
7
Medium Priority
?
358 Views
Last Modified: 2012-05-07
I have a form with 6 TextBoxes on it called..
to, addr1,addr2,city,state,zip
I would like for the user to click a button and and print a standard envelope with the textbox data in block address format.  How can this be done?
0
Comment
Question by:H-SC
[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
  • 4
  • 3
7 Comments
 
LVL 1

Author Comment

by:H-SC
ID: 24787198
CodeCruiser,

Thanks for the reply.. I have worked on this a bit and have the textboxes as parameters in a rdlc report.  how can I preset the printer to envelope so that the user does not have to preview and then set.  I would like to do this when the print button is clicked and not as a default on the printer itself
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 24789157
Hi,
Good to hear that you are making some progress. Here are a few pointers which would help you in changing printer settings. Also included is some example code

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_23652782.html

http://www.codeproject.com/KB/dotnet/NET_Printer_Library.aspx
Private settings As New PrinterSettings()
Private page As PageSettings
 
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Form1.Load
    '' Populate a combobox with all the printer names
    comboPrinters.BeginUpdate()
    comboPrinters.Items.Clear()
    For Each name As String In PrinterSettings.InstalledPrinters
        comboPrinters.Items.Add(name)
    Next
    comboPrinters.EndUpdate()
    comboPrinters.SelectedItem = settings.PrinterName
End Sub
 
Private Sub comboPaperSizes_SelectedValueChanged(ByVal sender As Object, ByVal e As EventArgs) Handles comboPaperSizes.SelectedValueChanged
    page = New PageSettings(settings)
    page.PaperSize = DirectCast(comboPaperSizes.SelectedValue, PaperSize)
End Sub
 
Private Sub comboPrinters_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles comboPrinters.SelectedIndexChanged
    '' Populate a combox with paper sizes 
    settings.PrinterName = DirectCast(comboPrinters.SelectedItem, String)
    Dim sizes As New BindingList(Of PaperSize)()
    For Each size As PaperSize In settings.PaperSizes
        sizes.Add(size)
    Next
    comboPaperSizes.DisplayMember = "PaperName"
    comboPaperSizes.DataSource = sizes
End Sub

Open in new window

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Author Comment

by:H-SC
ID: 24789387
CodeCruiser,

This is perfect...one more question on this.  Can I set the number Of Copies property anywhere via code.

Thank you again
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24792245
You can use the PrinterSettings.Copies property to set the number of copies to print.

settings.Copies = 5
0
 
LVL 1

Author Comment

by:H-SC
ID: 24793558
CodeCruiser,
many thanks! for your much needed help with this one
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24793591
I am happy that your problem is sorted.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 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