View Single Post
  #3  
Old February 13th 08, 12:10 PM posted to microsoft.public.outlook.program_vba
Peter Hibbs
external usenet poster
 
Posts: 30
Default EMail Send failure from Access

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")

Ads