microsoft.public.windows.live.mail.desktop
[Top] [All Lists]

Live Mail - smapi.dll - Windows 7

Subject: Live Mail - smapi.dll - Windows 7
From: "rick allison"
Date: Thu, 3 Jun 2010 21:12:08 -0400
Newsgroups: microsoft.public.windows.live.mail.desktop

I'm an MS Access developer.
I've use VBA code to access Windows Live Mail.
In Vista the smapi.dll file worked for me.

In Windows 7 the smapi.dll file no longer works for me.

Does anyone know if there is a difference between the smapi.dll files from Vista to Windows 7?

More specifically, in Vista smapi.dll is located here: c:\program files\windows live\mail\smapi.dll In Windows 7 smapi.dll is located here: c:\program files (x86)\windows live\mail\smapi.dll

In my VBA code I have the following...
'Declarations below:
'**************************
'   CONSTANT Declarations
'**************************
'


Global Const SUCCESS_SUCCESS = 0
Global Const MAPI_USER_ABORT = 1
Global Const MAPI_E_FAILURE = 2
Global Const MAPI_E_LOGIN_FAILURE = 3
Global Const MAPI_E_DISK_FULL = 4
Global Const MAPI_E_INSUFFICIENT_MEMORY = 5
Global Const MAPI_E_BLK_TOO_SMALL = 6
Global Const MAPI_E_TOO_MANY_SESSIONS = 8
Global Const MAPI_E_TOO_MANY_FILES = 9
Global Const MAPI_E_TOO_MANY_RECIPIENTS = 10
Global Const MAPI_E_ATTACHMENT_NOT_FOUND = 11
Global Const MAPI_E_ATTACHMENT_OPEN_FAILURE = 12
Global Const MAPI_E_ATTACHMENT_WRITE_FAILURE = 13
Global Const MAPI_E_UNKNOWN_RECIPIENT = 14
Global Const MAPI_E_BAD_RECIPTYPE = 15
Global Const MAPI_E_NO_MESSAGES = 16
Global Const MAPI_E_INVALID_MESSAGE = 17
Global Const MAPI_E_TEXT_TOO_LARGE = 18
Global Const MAPI_E_INVALID_SESSION = 19
Global Const MAPI_E_TYPE_NOT_SUPPORTED = 20
Global Const MAPI_E_AMBIGUOUS_RECIPIENT = 21
Global Const MAPI_E_MESSAGE_IN_USE = 22
Global Const MAPI_E_NETWORK_FAILURE = 23
Global Const MAPI_E_INVALID_EDITFIELDS = 24
Global Const MAPI_E_INVALID_RECIPS = 25
Global Const MAPI_E_NOT_SUPPORTED = 26


Global Const MAPI_E_NO_LIBRARY = 999
Global Const MAPI_E_INVALID_PARAMETER = 998


Global Const MAPI_ORIG = 0
Global Const MAPI_TO = 1
Global Const MAPI_CC = 2
Global Const MAPI_BCC = 3


Global Const MAPI_UNREAD = 1
Global Const MAPI_RECEIPT_REQUESTED = 2
Global Const MAPI_SENT = 4


'***********************
'   FLAG Declarations
'***********************


Global Const MAPI_LOGON_UI = &H1
Global Const MAPI_NEW_SESSION = &H2
Global Const MAPI_DIALOG = &H8
Global Const MAPI_UNREAD_ONLY = &H20
Global Const MAPI_ENVELOPE_ONLY = &H40
Global Const MAPI_PEEK = &H80
Global Const MAPI_GUARANTEE_FIFO = &H100
Global Const MAPI_BODY_AS_FILE = &H200
Global Const MAPI_AB_NOMODIFY = &H400
Global Const MAPI_SUPPRESS_ATTACH = &H800
Global Const MAPI_FORCE_DOWNLOAD = &H1000


Global Const MAPI_OLE = &H1
Global Const MAPI_OLE_STATIC = &H2


Type MAPIRecip
   Reserved As Long
   RecipClass As Long
   Name As String
   Address As String
   EIDSize As Long
   EntryID As Long 'Originally String
End Type


Type MAPIFileTag    'Not used at all now
   Reserved As Long
   TagLength As Long
   Tag() As Byte
   EncodingLength As Long
   Encoding() As Byte
End Type


Type MAPIFile
   Reserved As Long
   Flags As Long
   Position As Long
   pathname As String
   FileName As String
   FileType As Long 'Originally MAPIFileTag
End Type


Type MAPIMessage
   Reserved As Long
   Subject As String
   NoteText As String
   MessageType As String
   DateReceived As String
   ConversationID As String
   Flags As Long       ' Swapped with Originator
   Originator As Long  ' Swapped with Flags
   RecipCount As Long
   Recipients As Long
   FileCount As Long   ' Swapped with Files
   Files As Long       ' Swapped with Filecount
End Type


' send mail with windows live mail

Declare Function MAPISendMail Lib "c:\program files\windows live\mail\smapi.dll" ( _
   ByVal Session As Long, _
   ByVal UIParam As Long, _
   Message As MAPIMessage, _
   ByVal Flags As Long, _
   ByVal Reserved As Long) As Long

Declare Function MAPISendMail64 Lib "c:\program files (x86)\windows live\mail\smapi.dll" ( _
   ByVal Session As Long, _
   ByVal UIParam As Long, _
   Message As MAPIMessage, _
   ByVal Flags As Long, _
   ByVal Reserved As Long) As Long


Can I rename the function to MAPISendMail64?

Thanks,

Rick

<Prev in Thread] Current Thread [Next in Thread>