Is there a VBA way to open Print Properties Dialog?

daniels012

Well-known Member
Joined
Jan 13, 2005
Messages
5,219
I know I've seen where the print Dialog window can be opened.
Is there a way to open the Print PROPERTIES Dialog window?
:) :) :) :) :rolleyes:
Thank You,
Michael
 
Ivan,
i used your code:
Code:
Call Shell("rundll32 printui.dll,PrintUIEntry /p /n ""HP Deskjet 895 Cse""", vbNormalFocus)

I get the same error message as mentioned before.

Thank You,
Michael
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Is HP Deskjet 895 Cse

The Actual name of the printer case sensitive as it appears in your Printer control panel.
 
Upvote 0
I know I've seen where the print Dialog window can be opened.
Is there a way to open the Print PROPERTIES Dialog window?
Thank You,
Michael

Well it's been a really long time since this post was use, however, I happened to find the solution and thought I'd share it.

Michael you are basically on the right track, but you don't need to use "Call" just simply the shell command. I put this command in a function like this:

Code:
Public Function PrintOn2Pages() As Boolean 'name your function whatever you want
    On Error Resume Next
    ' also could try shell32.dll,SHHelpShortcuts_RunDLL PrintTestPage
    Shell "rundll32 PrintUI.dll, PrintUIEntry /n\\MHNPRNSV01\MNRm8SharpM453N /e", _
          vbNormalFocus 'substitute your own path to the printer after /n, the /e _
	  switch opens properties
End Function

That pops up the printer properties dialog for me. Note that there is no space after /n so just typer your exact path. I just went into AddPrinter dialog and selected the printer so I could make 100% sure it was the correct path. I'm sure there's other ways to do it, but that's what I did.

By the way, once you get this far, then if you want to check boxes or select single or duplex you have to use sendkeys. I haven't found a way yet to activate the controls otherwise.

Hope this helps the next guy
 
Upvote 0

Forum statistics

Threads
1,216,030
Messages
6,128,405
Members
449,448
Latest member
Andrew Slatter

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