RalphShnelvar Posted May 4, 2018 Share Posted May 4, 2018 I am a newbie user of AutoIT. I am trying to print to a specific printer ("Canon MX880 series FAX") and then issue a print. I have had no success WinMenuSelectItem to select a printer. I have had no success with ControlClick because, I think, it has no ID. AutoIt v3 Window Info reports: Property Button Class 50 Instance Button50 QassnameNN Name Advanced Mode [CLASS:Button; INSTANCE:50] ID Text Print Position 562, 606 Size 81, 26 ControOick Coords 40, 16 Style 0x50030000 ExStyle 0x00000000 Handle 0x051E2984 My crappy code, so far, is Run("C:\Program Files (x86)\AutoIt3\Au3info") ; Press ; ctrl/alt/f ; to unlock Au3info ; This works Run("""C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32"" ""f:\RDM brochures\Brochure028\004.pdf""") ; Wait 5 seconds for the Acrobat window to appear. WinWaitActive("[CLASS:AcrobatSDIWindow]", "", 5) ; Send ctrl P ; to open print dialog ; This works Send("^p") ; WinMenuSelectItem("Print", "[CLASS:ComboBox; INSTANCE:1]", "Canon MX880 series FAX") ; WinMenuSelectItem("Print", "Canon MX880 series FAX") ; This does not work ControlClick ("Print", "[CLASS:Button; INSTANCE:50]", "") Help, of course, would be deeply appreciated. Link to comment Share on other sites More sharing options...
bernd670 Posted May 4, 2018 Share Posted May 4, 2018 Hello, you can use the parmeter /t to direct print on a printer. AcroRd32.exe /t filename.pdf printername drivername portname printername – The name of your printer. drivername – Your printer driver’s name. Whatever appears in the Driver Used box when you view your printer’s properties. portname – The printer’s port. portname cannot contain any “/” characters; if it does, output is routed to the default port for that printer. greetingsbernd I hacked 127.0.0.1 -> Link to comment Share on other sites More sharing options...
RalphShnelvar Posted May 5, 2018 Author Share Posted May 5, 2018 Thank you so much! At least in my environment, the last two parameters are unnecessary. Ralph Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now