eckert1961
Registered User.
- Local time
- Yesterday, 19:38
- Joined
- Oct 25, 2004
- Messages
- 90
SOLVED:VBA Doesn't Open Mail Merge Word Document.
Hello,
I have an email mail merge document, "Email Receipt.doc" that I created in Winword 2003. In my Access 2003 database I want to open this document from a command button on my main form. I added the following code.
When I run the code, Word does launch but the document doesn't open and no error is reported. If I select the document from Word it opens up fine.
I've tried this code with regular documents and they open without a problem.
Is there any additional code required to make this work with a mail merge document?
The data source is a table, "tblEmailReceipts" that get's populated by a Make-Table query. The following is the sql statement from this query.
Any assistance would be greatly appreciated.
Regards,
Chris
Hello,
I have an email mail merge document, "Email Receipt.doc" that I created in Winword 2003. In my Access 2003 database I want to open this document from a command button on my main form. I added the following code.
Code:
Dim objWord As Word.Document
Set objWord = GetObject("K:\My Documents\Winword\Email Receipt.doc", "Word.document")
' Make Word visible
objWord.Application.Visible = True
When I run the code, Word does launch but the document doesn't open and no error is reported. If I select the document from Word it opens up fine.
I've tried this code with regular documents and they open without a problem.
Is there any additional code required to make this work with a mail merge document?
The data source is a table, "tblEmailReceipts" that get's populated by a Make-Table query. The following is the sql statement from this query.
Code:
SELECT Payments.PaymentID, Payments.MemberID, Payments.TrainingDues, Payments.JKFDues, Payments.Other, [TrainingDues]+Payments.JKFDues+[Other] AS [Total Payment], ConvertCurrencyToEnglish([Total Payment]) AS NumbertoEnglish, Payments.CheckNumber, Payments.PaymentDate, Payments.PaymentMethodID, Payments.Description, Payments.ReceiptPrinted, Members.FirstName, Members.LastName, Members.ParentsNames, Members.Email INTO tblEmailReceipts
FROM Members LEFT JOIN Payments ON Members.MemberID = Payments.MemberID
WHERE (((Payments.ReceiptPrinted)=No));
Any assistance would be greatly appreciated.
Regards,
Chris
Last edited: