M
Mark
I have a secured database runnning in Access 97 SR-2. I
have a form with some code that automatically generates an
email message in Outlook. It works fine on my computer.
The code starts off as follows
Dim wsCurrent As Workspace
Dim dbCurrent As Database
Dim qdfEmailAnnouncement As QueryDef
Dim rstEmailAnnouncement As Recordset
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim strEmail As String
Set wsCurrent = DBEngine.Workspaces(0)
Set dbCurrent = wsCurrent.Databases(0)
Set qdfEmailAnnouncement = dbCurrent.QueryDefs
("qryNGSEmailDistribution")
Set rstEmailAnnouncement =
qdfEmailAnnouncement.OpenRecordset(dbOpenSnapshot)
rstEmailAnnouncement.MoveFirst
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
But at my clients location when I launch the code it
generates an error message saying:
"Run-time error 458. Variable uses an Automation type not
supported in Visual Basic."
When I use the "debug" button it hangs up on the following
line of code:
Set objOutlook = CreateObject("Outlook.Application")
I have already checked to make sure that they have the
same reference libraries as I do on my computer.
Any idea as to what could be the problem?
Thanks if you have an answer!
Mark Weiler
Ontario Canada
have a form with some code that automatically generates an
email message in Outlook. It works fine on my computer.
The code starts off as follows
Dim wsCurrent As Workspace
Dim dbCurrent As Database
Dim qdfEmailAnnouncement As QueryDef
Dim rstEmailAnnouncement As Recordset
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim strEmail As String
Set wsCurrent = DBEngine.Workspaces(0)
Set dbCurrent = wsCurrent.Databases(0)
Set qdfEmailAnnouncement = dbCurrent.QueryDefs
("qryNGSEmailDistribution")
Set rstEmailAnnouncement =
qdfEmailAnnouncement.OpenRecordset(dbOpenSnapshot)
rstEmailAnnouncement.MoveFirst
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
But at my clients location when I launch the code it
generates an error message saying:
"Run-time error 458. Variable uses an Automation type not
supported in Visual Basic."
When I use the "debug" button it hangs up on the following
line of code:
Set objOutlook = CreateObject("Outlook.Application")
I have already checked to make sure that they have the
same reference libraries as I do on my computer.
Any idea as to what could be the problem?
Thanks if you have an answer!
Mark Weiler
Ontario Canada