dmorand Posted January 25, 2008 Share Posted January 25, 2008 I've written a script to call an access macro which runs a report and automatically prints the report to various printers. I'm having trouble determining when I need to have access exit. I need to quit access once it's done printing the report, but I don't know how to determine that it's happened so I end up closing access too early. Here is a snippet of my code: Run(@ProgramFilesDir & "\Microsoft Office\OFFICE11\msaccess.exe " & $database & " /x " & $macro) ;Make sure that the database window is active, otherwise wait for it to be active WinWaitActive("Siemens Medication Administration Check Reports 23.4-3") Link to comment Share on other sites More sharing options...
erezlevi Posted January 25, 2008 Share Posted January 25, 2008 I've written a script to call an access macro which runs a report and automatically prints the report to various printers. I'm having trouble determining when I need to have access exit. I need to quit access once it's done printing the report, but I don't know how to determine that it's happened so I end up closing access too early. Here is a snippet of my code: Run(@ProgramFilesDir & "\Microsoft Office\OFFICE11\msaccess.exe " & $database & " /x " & $macro) ;Make sure that the database window is active, otherwise wait for it to be active WinWaitActive("Siemens Medication Administration Check Reports 23.4-3") are the printers located on the same computer? if so wait for the tray icon of the printer to go away. you can get the handle of it I think. Link to comment Share on other sites More sharing options...
dmorand Posted January 25, 2008 Author Share Posted January 25, 2008 I have the printers setup on my computer. I'll give that a shot and update with how that works. Thanks!! 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