Setting advanced printer settings with vba

mountainfish

New Member
Joined
Apr 29, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Kudos to all who have asked and answered to get me this far. I can change all sorts of printer settings now in vba. It appears that I need to go deeper now.

I am trying to change deeper level advanced options and I am coming up dry.
If I go to -> file: print: printer properties: advanced: and then from here I need to change two things:
  1. change Graphic: Print Quality from "300 x 300" to "300 x 600" dpi.
  2. Printer Features: Print Quality from "text only" to "barcodes and graphics"
    1651264072691.png
    1651264264594.png
    1651264441205.png
I have used successfully the Application.pagesetup code snippet to change things like: orientation, page size, margins, etc. But in this case I cannot figure out how to go deeper.

I do have the ability to change something that seems like it should work:
Application.PageSetup.PrintQuality = Array(300, 600)
This might actually be doing something, but I also need the "Text Only" to be changed. I am at a total loss for direction here.

Code below for additional detail.

Sub printerSettings()

Dim ws As Worksheet, ps As PageSetup
Set ws = ActiveSheet
Set ps = ws.PageSetup

'Application.Dialogs(xlDialogPrinterSetup).Show

If ws.Name <> "Sheet1" Then MsgBox ("Wrong Printer"): End 'Exit point in event of working on wrong sheet.

Application.ActivePrinter = "DYMO LabelWriter 450 Turbo on Ne03:"

With ps
.PrintArea = "$B$4:$B$5"
.BottomMargin = 0
.TopMargin = 0
.RightMargin = 0
.LeftMargin = 0
.Zoom = 100
.PaperSize = 126
.PrintQuality = Array(300, 600)
.Orientation = xlLandscape
End With

Call PrintStuff

End Sub
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
But in this case I cannot figure out how to go deeper.
If I were trying to do what you are trying to do, I would use the macro recorder myself using the menus to do what I wanted to do. Then I would inspect the macro recorder VBA code to see what the correct syntax is to make the changes I want.
 
Upvote 0

Forum statistics

Threads
1,223,954
Messages
6,175,603
Members
452,658
Latest member
GStorm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top