alanjbrown
asked on
How to ensure MsWord dialog boxes come to front when using Word via Automation
I am performing mail merges from Word XP controlled from Delphi using TwordApplication. Some of the word templates have dialog boxes to prompt the user for additional information during the merge. I have set wd1.visible := true, however on some occasions the word dialog goes behind the Delphi application, the user is not aware that word is waiting for his input and after a long wait the user closes the application in task manager.
How do I ensure that the dialog always is on top?
Thanks in anticipation.
Alan
How do I ensure that the dialog always is on top?
Thanks in anticipation.
Alan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
OpusApp refers the the window class that Microsoft for MS Word. (eg, the return value of GetClassName(hwnd, ...)).
Russell
ASKER
Thanks, I understand now.
Will get back to you soon.
Alan
Will get back to you soon.
Alan
ASKER
Russell
It appears to have done the trick. It has not gone wrong once during testing!
Thank you very much for the help. Sorry for the delay in responding.
Alan
It appears to have done the trick. It has not gone wrong once during testing!
Thank you very much for the help. Sorry for the delay in responding.
Alan
No problem with the delay, glad it works well for you.
Russell
Russell
ASKER
I will not be able to try it untill tommorow as I am away from the office and don't have Delphi on my home PC. However what does OpusApp in FindWindow refer to?
Thanks
Alan