Hi Mike,
You may have an instance of Outlook open of which you are not aware. The following code will check for that.
'Get an instance of Outlook
On Error Resume Next
' Outlook is not already open--this method will create an error
Set olApp = GetObject(, "Outlook.Application")
If Err.Number <> 0 Then
Err.Clear
' Outlook is not open, create a new instance
Set olApp = CreateObject("Outlook.Application")
End If
'Modify the line of code below for your error handling code
On Error GoTo ErrHandle
Kind Regards,
Patrick Wood
Microsoft Access MVP
Gaining Access Technologies Founder
http://gainingaccess.net
Microsoft Access and SQL Azure Information Center for Developers:
http://gainingaccess.net/SQLAzure/AccessAndSQLAzureInfo.aspx
--- In MS_Access_Professionals@yahoogroups.com, mithomas48 <no_reply@...> wrote:
>
> When sending an email, I noticed that even though I use a line to create an instance of Outlook, I get an Application or Object defined error if I DO NOT physically have Outlook open. Below is the syntax being used to create the instance of Outlook. Shouldn't we be able to create the object and send the email even if Outlook is not opened?
>
>
> Set olApp = CreateObject("Outlook.Application")
>
> Thanks in advance!
> Mike
>
Selasa, 20 Maret 2012
[MS_AccessPros] Re: Outlook Error
__._,_.___
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar