fafafoooey Posted September 29, 2014 Share Posted September 29, 2014 Hello, rookie scripter here. I am trying to create a script that opens a document, prints the doc, then closes Word/Excel. I have the open and close part no problem. I am trying to come up with a way to have the user enter in the printserverprintername info when the script is launched so that the document will print to the user's printer. I was able to print to the default printer, but have tried to accept parameters, but no luck so far. Here is what I have created so far. Thanks for any help and input. Word2MBPrint.au3 Link to comment Share on other sites More sharing options...
MikahS Posted September 29, 2014 Share Posted September 29, 2014 Have a look at _WinAPI_PrintDlg() Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
fafafoooey Posted September 30, 2014 Author Share Posted September 30, 2014 Hi MikahS, thanks for the reply. I tried using the sample code and it seems that it just brings up the normal gui print dialog. I was trying to see if I could use something that could be passed into the script via the command line like, Word2MBPrint.exe printerservernameprintername Thanks in advance for any help. Link to comment Share on other sites More sharing options...
MikahS Posted September 30, 2014 Share Posted September 30, 2014 (edited) Do something like this: Local $iBox = InputBox("Set printer", "\\printerservername\printername") MsgBox(0, "", $con) ; just to show you the input the user has entered;; example Once the user has entered this information in you can then set the print function as so; _Word_DocPrint($oWord, Default, Default, Default, Default, $iBox) Edited September 30, 2014 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ 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