EMail Send failure from Access
Peter, I cannot reproduce that error. If I add a call to Logon:
Set Ns = myObject.GetNamespace("Mapi")
Ns.Logon
everything works fine.
--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6
Am Wed, 13 Feb 2008 12:10:30 +0000 schrieb Peter Hibbs:
Michael,
Unfortunately not, the same error occurs. The code at the start of the
function looks like this now, I assume that is what you intended.
---------------------------------------------------------------------------
Public Function SendMail(strRecipients As String, strSubject As
String, strBody As String) As String
Dim myObject As Object, myItem As Object
Dim vCount As Long
Dim Ns As Outlook.Namespace
On Error GoTo ProcError
Set myObject = CreateObject("Outlook.Application")
Set Ns = myObject.GetNamespace("Mapi")
Set myItem = myObject.CreateItem(0)
.... continues as shown in original post.
--------------------------------------------------------------------------
Any other thoughts.
Peter Hibbs.
On Wed, 13 Feb 2008 06:59:48 +0100, "Michael Bauer [MVP - Outlook]"
wrote:
Does it work if you add this?
Dim Ns as Outlook.Namespace
Set myObject = CreateObject("Outlook.Application")
Set Ns=myObject.GetNamespace("Mapi")
|