Visio has command line switches and parameters. Have you tried using them?
Powershell or VBS to print file already opened by Internet Explorer
Visio file (vsd extension), unfortunately, to print needs File Open as prerequisite.; can't be printed by Windows 10 File Explorer Right-Click-Print.
File Open to print becomes tedious with numerous such files.
I have script to drop file into PS script to open file with IE; but have not figure out script to
- save file (timestamping original name ) already opened by IE
- setup page layout
- prompt user to send to printer
This is Windows 10 Enterprise.
4 answers
Sort by: Most helpful
-
-
Limitless Technology 39,351 Reputation points
2021-10-27T08:03:53.687+00:00 Hi there,
The Invoke-Item cmdlet performs the default action on the specified item. For example, it runs an executable file or opens a document file in the application associated with the document file type.
This command opens all of the Microsoft Office Excel spreadsheets in the C:\Documents and Settings\Lister\My Documents folder. Each spreadsheet is opened in a new instance of Excel. In this case, opening in Excel is the default action for .xls files.
Invoke-Item "C:\Documents and Settings\Lister\My Documents*.xls"
------------------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer--
-
Sunny Wong 1 Reputation point
2021-10-27T08:04:31.82+00:00 My job not expected to need Visio; waiting for approval to get Visio.
With no app to try, i can only find
[command-line-switches-for-microsoft-visio-2010-f1de9af3-8368-4ef0-9a2f-25d430ec5576][1].
which didn't mention anything for printing.I have yet found "Command-line switches for Microsoft Visio 365"
If you know where, I appreciate info.
-
Rich Matheisen 44,776 Reputation points
2021-10-27T14:56:33.387+00:00 You would probably have more success using an IE COM object.
To print to your default printer, use something like this "$IE.ExecWB(6,2)"