Hi

 

I have a ShellExecute command which prints a PDF document to a printer. If I put a MessageDlg following the command, or a sleep of 1 second, it prints to the correct printer I've named. If I don't do one of these, it prints to my default printer! (this was the behaviour when I had an NT machine).

 

I've just moved to XP and a much faster machine. Now it won't work even if I put a sleep of 15 seconds! But will work if I follow the ShellExecute with a MessageDlg. I tried Application.ProcessMessages instead, but this didn't work. I assume this problem is something related to Windows messaging? Here's my command:

ShellExecute(Handle, 'print', PChar(RepAdviceDoc), PChar('\\NZAKL14SV001\DO_NOT_USE'), nil, SW_HIDE);

MessageDlg('need this command in order to print to correct printer!',mtInformation,[mbOK],0);

 

Any ideas or suggestions? Thanks.

 

Dave Jollie

Tower NZ IT

09 368 4259

 

<<attachment: image001.gif>>

Reply via email to