Set Default Printer Paper Size
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anybody answer the following question???
I need to "Programatically", using Visual Studio, set the default printers paper size to either "A4" or "A3".
I have the following code that gets the required paper size ("A4" or "A3") from the registry and checks that the default printer supports "A3". If it does I want to set the paper size to "A3".
Can this be done????
Here is my code so far....
Imports Microsoft.Win32
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim SetPaperSize As String
Dim PrinterPaperSize As String
SetPaperSize = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\MechTools\", "Printer Paper Size", "0")
For Counter = 0 To PrintDialog1.PrinterSettings.PaperSizes.Count
PrinterPaperSize = PrintDialog1.PrinterSettings.PaperSizes.Item(Counter).PaperName
If PrinterPaperSize = SetPaperSize Then
' MsgBox(SetPaperSize) HERE IS WHERE I NEED THE CODE TO SET THE PAPER SIZE
Exit For
End If
Next
End
End Sub
End Class
Many thanks in advance!!!