I need to generate an email to send to guest of a resort the day before they are scheduled to arrive. The Email contains a QR code to identify them at the gate when they arrive. I have completed several task to accomplish this.
1. I have an Excel routine that extracts data from the scheduling database and grooms it for a mail merge.
2. I have a mail merge in word that uses the mailing list from excel to create an email and generate the QR code.
3. I have a macro in word that sends the email to the list. I have it set to run when the document is close.

If I open the word doc manually, it ask (Yes / No - “Data from your database will be placed in this document”. I answer (Yes) and when I close the document the macro runs and it sends the emails.

When I use a Visual Basic Script to open and close the document, the macro encounters an error.
(Run-Time error: “5852”: Requested object is not available)
When you debug it points out: .Destination = wdSendToEmail

It seems that it does not know who to send the letter to.
Perhaps the question “Data from your database will be placed in this document” needs to be answered in the VBS script?

Any thoughts?