I have added both SENDKEYS and Direct VB, using SENDKEYS where there is no alternative. Here is the Hybrid Hybrid Script . Note: The idea behind "DUPLEXSENDKEYS" is to send it when not using a double sided default printer. If you have a single sided printer and wish to use "DUPLEXFLIPON" you must also set DUPLEXSENDKEYS to true, but if you have a double sided default printer, then you can JUST set "DUPLEXFLIPON=Short" to adjust default (assumption is default is "long").
I'm leaving below using SENDKEYS, but there is no need w/ Office Products it can be directly printed via VB and that is preferred.
Via VBScript/Batch Hybrid to manipulate Print Options Only configured for "pages", but you can easily adapt. But, SENDKEYS is notoriously not a great approach. I generally have a check outside both scripts to see if any argument was passed and use either WINWORD.EXE or Hybrid if needed.
The way it seems to work is you have to print to the default printer, so what I created where CMD's which set the default printer to desired printer, printed document (as argument) and set back default (if it needed changing).
Eg: My deafult printer prints 'Single Sided" but the best/only way to script double sided is to setup a separate printer w/ double sided as default, so this is my CMD to print a doc double sided
Setting Default Printer:
Switch and parameter
Starts Word in Safe Mode.
Starts Word without displaying the Word splash screen.
Starts Word with a new document based on a template other than the Normal template.
Example To start Word with a document based on a template called Myfax.dotx, stored on the C drive, type the following at the command prompt:
Note: Do not include a space between the switch and the name of the template file.
Security Note: Because templates can store macro viruses, be careful about opening them or creating files based on new templates. Take the following precautions: run up-to-date antivirus software on your computer, set your macro security level to high, clear the Trust all installed add-ins and templates check box, use digital signatures, and maintain a list of trusted sources.
Starts Word and opens an existing file.
Example To start Word and open the template file Myfax.dotx, stored on the C drive, type the following at the command prompt:
Example To start Word and open multiple files, such as MyFile.docx and MyFile2.docx, each stored on the C drive, type the following at the command prompt:
/t c:\MyFile.docx c:\MyFile2.docx
Starts Word with a new document based on an existing file.
Example To start Word and create a new document based on file MyFile.docx, stored on the desktop, type the following at the command prompt:
/f "c:\Documents and Settings\All Users\Desktop\MyFile.docx"
Starts Word and opens a read-only copy of a document that is stored on a Microsoft Windows SharePoint Services site. The site must be on a computer that is running Word 2007 or later or Windows SharePoint Services 2.0 or later.
Example To start Word and open a copy of file MyFile.docx, stored in a document library at the URL http://MySite/Documents, type the following at the command prompt:
Note: If the document is checked out to you, the /h switch has no effect. Word opens the file so that you can edit it.
Starts Word and opens an existing XML document based on the specified Extensible Stylesheet Language Transformation (XSLT).
Example To start Word and apply the XSLT MyTransform, stored on the C drive, to the XML file Data.xml, also stored on the C drive, type the following at the command prompt:
Starts Word and prevents add-ins and global templates (including the Normal template) from being loaded automatically. The /a switch also locks the setting files.
Starts Word and then loads a specific Word add-in.
Example To start Word and then load the add-in Sales.dll, stored on the C drive, type the following at the command prompt:
Note: Do not include a space between the switch and the add-in name.
Security Note: Use caution when running executable files or code in macros or applications. Executable files or code can be used to carry out actions that might compromise the security of your computer and data.
Starts Word without running any AutoExec macros.
Starts Word and then runs a specific macro. The /m switch also prevents Word from running any AutoExec macros.
Example To start Word and then run the macro Salelead, type the following at the command prompt:
Note: Do not include a space between the switch and the macro name.
Because macros can contain viruses, be careful about running them. Take the following precautions: run up-to-date antivirus software on your computer; set your macro security level to high; clear the Trust all installed add-ins and templates check box; use digital signatures; maintain a list of trusted publishers.
Starts a new instance of Word with no document open. Documents opened in each instance of Word will not appear as choices in the Switch Windows list of other instances.
Starts a new instance of Word with a blank document. Documents opened in each instance of Word will not appear as choices in the Switch Windows list of the other instances.
Re-registers Word in the Windows registry. This switch starts Word, runs Office Setup, updates the Windows registry, and then closes.
Starts Word from the operating system shell so that Word responds to only one Dynamic Data Exchange (DDE) request (for example, to print a document programmatically).
Visibly behaves exactly like the /t switch. However, you can use the /z switch with Word to generate both a Startup and a New event, whereas the /t switch generates only a Startup event.