>>How can I respond automatically to them (I only want to press Enter).
>
>Alternatively, here is a method to send a keystorke to the active window.
>This assumes you know the title of the window to send the keystroke to.
Sorry, it doesn't work. I have tried many things with your procedure. FindWindow always returns 0.
What I am doing is the following:
-I read the contents of a directory and then ask to print elements. For Excel, Word and Project, I use automation because I have other parameters to pass (a password) and then call the VBA Print method (PrintOut, PrintOut and FilePrint in the same order). Excel and Word ask no questions and print. It's not the case of Project!!!
-For Powerpoint, I now use VBA automation and it seems to work.
-For all others documents, I use ShellExecute API function with the Print parameter.
So my problems is now again Project!
Thanks
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com