Link to home
Start Free TrialLog in
Avatar of hoanvula
hoanvulaFlag for Canada

asked on

shellexecute to print and close app after

Hi,
   I want to print any kind(pdf, doc,xls...) of document. Everything work with ShellExecute but the application open (exemple acrobat) does close after printing. I want to know how to close it after the print.

t = ShellExecute(0, "Print", "c:\temp\toto.pdf", "", "", 0)

Best regards
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Are you really working in VB.Net?...or is this VB6?
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hoanvula

ASKER

Hi,

  You can replace Delay by System.Threading.Thread.Sleep(5000)

Best regards
You could...but only if having your GUI frozen and unresponsive for five seconds is acceptable to you.  ;)

(a timer would allow the closing portion to be placed in a different sub and avoid both delay and sleep)