question

seankudusi-5367 avatar image
0 Votes"
seankudusi-5367 asked ·

VB script for printing on windows 10

Hi,

I wanted to print a file using VB script. Static file will be stored in disk so i need to print that static file using vb script.

Does anyone has an idea how to print the pdf file using vb script stored in some folder in disk?

windows-10-general
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MotoX80 avatar image
0 Votes"
MotoX80 answered ·
·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DaleKudusi-MSFT avatar image
0 Votes"
DaleKudusi-MSFT answered ·

Hi,
Please refer to these helpful discussion here:
https://stackoverflow.com/questions/50920097/printing-pdf-files-using-vbs

Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information

Best regards.


If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Castorix31 avatar image
0 Votes"
Castorix31 answered ·

Or this minimal test script works for me with a .pdf file passed as argument :

 Set objShell = CreateObject("Shell.Application")
 strFile = WScript.Arguments.Item(0)
 objShell.ShellExecute strFile, "", "", "print", 0
·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.