I am having trouble with one of my modules. It is sending the key too quickly and document does not open. Here is the section that has the problems:
OpenWord = Shell("C:\Program Files\Microsoft Office\Office\WINWORD.EXE", 1)
SendKeys "%(fo)"
SendKeys " \\NDS2\MktgDB\MailMergeLetters\Copy of NewGeneralLetter120899", True
SendKeys "% (o)", True
SendKeys "% (o)", True
SendKeys "% (trmm)", True'Merges letter to query
SendKeys "^ (p)", True'print letter
SendKeys "{enter}", True
SendKeys "% ({f4})", True'close letter
SendKeys "% (nn)", True'do not save letter
1. Is there a way to make it wait for the document to be found? It is just taking a while to find the document on the network.
2. Is there a way to automate the mailmerge that is going on here without sending keys?
Thanks,
Dave
OpenWord = Shell("C:\Program Files\Microsoft Office\Office\WINWORD.EXE", 1)
SendKeys "%(fo)"
SendKeys " \\NDS2\MktgDB\MailMergeLetters\Copy of NewGeneralLetter120899", True
SendKeys "% (o)", True
SendKeys "% (o)", True
SendKeys "% (trmm)", True'Merges letter to query
SendKeys "^ (p)", True'print letter
SendKeys "{enter}", True
SendKeys "% ({f4})", True'close letter
SendKeys "% (nn)", True'do not save letter
1. Is there a way to make it wait for the document to be found? It is just taking a while to find the document on the network.
2. Is there a way to automate the mailmerge that is going on here without sending keys?
Thanks,
Dave