Auto answer a word dialog box from VB
Posted on 1997-06-08
I'm only a beginner at the VB game as I've only just had a three day course but thought that I'd dive in at the deep(ish) end - but I'm stuck.
I currently writing a system whereby I receive data from an AS/400 and produce a 'standard' letter made up of various paragraphs (held as individual Word documents) with variable inserted as into the text. The choice of paragraph is dependant upon the AS/400 data.
I've got VB opening up Word, then loading a base (empty) document with the mail merge set up. I then insert the appropriate paragraph texts. All this works fine until I come to print. I send off the .mailmerge command to Word which seems to work fine except that Word then opens up a Dialog box requesting the number of copies etc.
What I am unable to do is automatically reply an OK to this. I've tried using SendKeys, I've tried just to send a carriage return but to no avail.
I need to auto reply as this system is to sit on a machine all days processing letter requests and shouldn't require user intervention.
Can anyone out there help ??
Thanks in advance