WSIT
asked on
Error 13 (type mismatch) when sending emails from access
Hi
I'm getting error 13 (type mismatch) when attempting to send emails from within Access 2003.
My code (which works for other clients) is:
Global OutlookApplication As Outlook.Application, OutlookMail As Outlook.MailItem, Inbox As Outlook.MAPIFolder, DetailSectionLeftDescripti onLabel As String
Set OutlookApplication = New Outlook.Application
Set OutlookMail = Outlook.Application.Create Item(olMai lItem)
I get error 13 with the last line. The Client has Access 2003 and Office 2010 on a 32bit Win 7 PC. The project has a reference for Microsoft Outlook 14.0 Object Library added and I have tried moving it up the reference list as far as it can go.
Any help would be appreciated
Kim
I'm getting error 13 (type mismatch) when attempting to send emails from within Access 2003.
My code (which works for other clients) is:
Global OutlookApplication As Outlook.Application, OutlookMail As Outlook.MailItem, Inbox As Outlook.MAPIFolder, DetailSectionLeftDescripti
Set OutlookApplication = New Outlook.Application
Set OutlookMail = Outlook.Application.Create
I get error 13 with the last line. The Client has Access 2003 and Office 2010 on a 32bit Win 7 PC. The project has a reference for Microsoft Outlook 14.0 Object Library added and I have tried moving it up the reference list as far as it can go.
Any help would be appreciated
Kim
Also, just for kicks - If you don't have it already, place the following line at the top of this code module, right under Option CompareDatabase:
Then compile your code, fixing any errors to ensure that all variables, Outlook constants, etc are recognized on your client's computer.
Option Explicit
Then compile your code, fixing any errors to ensure that all variables, Outlook constants, etc are recognized on your client's computer.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I in the process of testing your ideas when I got a call to say they 'repaired' the Office installation and it then worked fine. Why it would need repairing on all three PCs I couldn't tell you. But thanks for the help.
Set OutlookMail = OutlookApplication.CreateI
(I've dropped the 'dot' in Outlook.Application)