theaminator Posted September 30, 2011 Share Posted September 30, 2011 I'm trying to print several files, some .docx, .xlsx, .pdf. The pdf's are KILLING me! I'm using ShellExecuteWait($file1,"","","print") This prints the pdf just fine. But, Adobe Acrobat Reader hangs open. The file closes; but the program doesn't. I tried adding a ProcessClose ("AcroRd32.exe") But, it won't move to this line, as it is still 'waiting' per the ShellExecuteWait command. Also tried ShellExecute($file1,"","","print") ProcessClose ("AcroRd32.exe") But, the ProcessClose takes over before the ShellExecute can perform the print task. Please help! Link to comment Share on other sites More sharing options...
Clark Posted September 30, 2011 Share Posted September 30, 2011 Just an idea, I was wondering if you used ShellExecuteWait to open the document, then send the keys to print the document, then used the ProcessClose, whether that might work. Link to comment Share on other sites More sharing options...
theaminator Posted September 30, 2011 Author Share Posted September 30, 2011 How would I send the keys? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 30, 2011 Moderators Share Posted September 30, 2011 theaminator,How would I send the keys?Perhaps open the Help file and look at Send? M23 Unsigned 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
theaminator Posted October 5, 2011 Author Share Posted October 5, 2011 I wouldn't have asked if I hadn't already spent HOURS combing through help. What I didn't understand is what key I was supposed to be sending to close the app window. In the end, I found an answer on another site. There's a bug in Adobe Reader that prevents closing the program. There were different recommendations out there for using DDE. But, as I am not developing robust code, just providing a means for my receptionist to print a packet of files, I chose to use the brute force route, by pausing the method between printing and closing the program. ShellExecute($file1,"","","print") Sleep(5000) ProcessClose ("AcroRd32.exe") That did it. But, for others with this same problem, know that there are other, better answers out there. Link to comment Share on other sites More sharing options...
ReFran Posted October 6, 2011 Share Posted October 6, 2011 "But, for others with this same problem, know that there are other, better answers out there" Mmmh,you can find all answers along with scipts also here: best regards, Reinhard Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now