Sign in to follow this  
Followers 0
fafafoooey

Print to Word or Excel to a printer that the user specifies...

4 posts in this topic

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

Share this post


Link to post
Share on other sites



Have a look at

_WinAPI_PrintDlg()

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My 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

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My 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

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0