Jump to content

ShellExecute to Print


 Share

Recommended Posts

I had viewed other posts on Shell Execute and looked at the help file.

Here is my question (here is what I have used):

ShellExecute ( "Food.pdf" , "" ,"C:\My Files",$SHEX_PRINT  )

I am misunderstand something on this. Is this to take the document straight to the printer with no intervention or user input?

When using the above, the document opens on the screen where from there I could click the regular print request if I wanted to, but I was looking to avoid that part.  I actually have the above in a print button on my control.  It appears the above executes the same as

ShellExecute ( "C:\My Files\Food.pdf  " ).  I never knew about the $SHEX_PRINT.

 

Hobbyist

 

Link to comment
Share on other sites

Thanks for taking time to read my post and comment.

I had also previously tried what you suggested before I came to the forum with my question.

I was hoping to be able to get a file to print without having to open it and then print.  I think that would be a time saver for me. If you think of anything else let me know.  This has got me perplexed or I just don't understand the command in question.

 

Hobbyist

Link to comment
Share on other sites

Hobbyist,

           This is what I use to print pdf files without having to open them.  Prints directly to the default printer. 

Download and install SumatraPDF.   It is free software.   Then create this batch file

@echo off
SET printing=c:\Temp
SET Sumatra=C:\Program Files\SumatraPDF\SumatraPDF.exe

FOR %%F IN (%printing%\*.*) DO "%Sumatra%" -print-to-default "%%~fF"

exit

 

This will print all the pdf files within the SET printing folder without having to open them.

 

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...