Live Mail - smapi.dll - Windows 7

Discussion in 'Windows Live Mail' started by rick allison, Jun 4, 2010.

  1. rick allison

    rick allison Guest

    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
     
    rick allison, Jun 4, 2010
    #1
    1. Advertising

  2. rick allison

    ...winston Guest

    The API for WLM has not been made public..I don't recall any information available that would answer your question.

    --
    ...winston
    ms-mvp mail

    "rick allison" <> wrote in message news:...
    > 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
    >
    >
     
    ...winston, Jun 4, 2010
    #2
    1. Advertising

  3. Why use the WLM version of that file directly? If you use the system's
    mapi32.dll it will use the default mail client on the machine.

    -geoff

    "...winston" wrote in message news:...

    The API for WLM has not been made public..I don't recall any information
    available that would answer your question.

    --
    ...winston
    ms-mvp mail

    "rick allison" <> wrote in message
    news:...
    > 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
    >
    >
     
    Geoff Clark \(MSFT\), Jun 4, 2010
    #3
  4. The difference in file locations is because you are running a 32 bit
    version of Vista and a 64 bit version of Win7.

    On a 64 bit version of Windows, 32 bit applications get installed to
    c:\program files (x86)

    --

    Mike - http://TechHelp.Santovec.us



    "rick allison" <> wrote in message
    news:...
    > 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
     
    Michael Santovec, Jun 4, 2010
    #4
  5. rick allison

    rick allison Guest

    Oh no, no API.

    I took the code I had for Outlook Express and used it. I had to remove the
    file attachment variable to make it work.

    "...winston" <> wrote in message
    news:...
    > The API for WLM has not been made public..I don't recall any information
    > available that would answer your question.
    >
    > --
    > ...winston
    > ms-mvp mail
    >
    > "rick allison" <> wrote in message
    > news:...
    >> 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
    >>
    >>
     
    rick allison, Jun 7, 2010
    #5
  6. rick allison

    rick allison Guest

    I want to force the use of WLM and not make the user have to use WLM as
    their default mail system. Many of my customers want to use Outlook as
    their default mail system and I cannot programmatically turn off the warning
    message about sending email from another program. As far as I know, this
    warning message cannot be turned of from Outlook like it can from WLM.

    Rick

    "Geoff Clark (MSFT)" <> wrote in message
    news:...
    > Why use the WLM version of that file directly? If you use the system's
    > mapi32.dll it will use the default mail client on the machine.
    >
    > -geoff
    >
    > "...winston" wrote in message
    > news:...
    >
    > The API for WLM has not been made public..I don't recall any information
    > available that would answer your question.
    >
    > --
    > ...winston
    > ms-mvp mail
    >
    > "rick allison" <> wrote in message
    > news:...
    >> 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
    >>
    >>

    >
     
    rick allison, Jun 7, 2010
    #6
  7. rick allison

    rick allison Guest

    Update on what has happened.

    I created another module in Access (WLM32in64) because I have to hard code
    the folder in the function
    Declare Function MAPISendMail 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

    When I did this it works.

    What I've learned...
    1) the function must be called MAPISendMail.
    2) in Windows 7 the first and second attempt to send an email fail, the
    third attempt succeeds. This happens only on the first attempt to send an
    email with windows live mail and the MAPISendMail function. I have no idea
    why.
    Code to make sending mail work for the very first email sent.
    MAPISendMail
    If MAPIError then
    MAPISendMail
    if MAPIError then
    MAPISendMail - the email is sent on the third attempt.
    end if
    end if

    What's strange is this, in Vista MAPISendMail has to try twice and in
    Windows XP it works every time on the first attempt.
    Remember, this is for the very first email being sent from MS Access upon
    opening of the MS Access program. Once the first email attempt is complete,
    every email after that works on the first attempt. No need to try two or
    three times. That's just plain weird to me. But heck it works.

    I hope this helps someone else.

    If there is a better way to do this, I'm very interested.

    Rick

    "Michael Santovec" <> wrote in message
    news:...
    > The difference in file locations is because you are running a 32 bit
    > version of Vista and a 64 bit version of Win7.
    >
    > On a 64 bit version of Windows, 32 bit applications get installed to
    > c:\program files (x86)
    >
    > --
    >
    > Mike - http://TechHelp.Santovec.us
    >
    >
    >
    > "rick allison" <> wrote in message
    > news:...
    >> 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

    >
    >
     
    rick allison, Jun 16, 2010
    #7
  8. rick allison

    C C Guest

    according to this article
    http://msdn.microsoft.com/en-us/library/dd296721(v=vs.85).aspx
    Windows Live Mail as of Sept 09, does not support MAPISendmail

    > On Thursday, June 03, 2010 9:12 PM rick allison wrote:


    > I am an MS Access developer.
    > I have 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



    >> On Thursday, June 03, 2010 10:42 PM ...winston wrote:


    >> The API for WLM has not been made public..I do not recall any information available that would answer your question.
    >>
    >> --
    >> ...winston
    >> ms-mvp mail



    >>> On Friday, June 04, 2010 7:36 AM Geoff Clark \(MSFT\) wrote:


    >>> Why use the WLM version of that file directly? If you use the system's
    >>> mapi32.dll it will use the default mail client on the machine.
    >>>
    >>> -geoff
    >>>
    >>>
    >>> The API for WLM has not been made public..I do not recall any information
    >>> available that would answer your question.
    >>>
    >>> --
    >>> ...winston
    >>> ms-mvp mail



    >>>> On Friday, June 04, 2010 5:12 PM Michael Santovec wrote:


    >>>> The difference in file locations is because you are running a 32 bit
    >>>> version of Vista and a 64 bit version of Win7.
    >>>>
    >>>> On a 64 bit version of Windows, 32 bit applications get installed to
    >>>> c:\program files (x86)
    >>>>
    >>>> --
    >>>>
    >>>> Mike - http://TechHelp.Santovec.us



    >>>>> On Monday, June 07, 2010 12:15 PM rick allison wrote:


    >>>>> Oh no, no API.
    >>>>>
    >>>>> I took the code I had for Outlook Express and used it. I had to remove the
    >>>>> file attachment variable to make it work.



    >>>>>> On Monday, June 07, 2010 12:17 PM rick allison wrote:


    >>>>>> I want to force the use of WLM and not make the user have to use WLM as
    >>>>>> their default mail system. Many of my customers want to use Outlook as
    >>>>>> their default mail system and I cannot programmatically turn off the warning
    >>>>>> message about sending email from another program. As far as I know, this
    >>>>>> warning message cannot be turned of from Outlook like it can from WLM.
    >>>>>>
    >>>>>> Rick



    >>>>>>> On Wednesday, June 16, 2010 9:53 AM rick allison wrote:


    >>>>>>> Update on what has happened.
    >>>>>>>
    >>>>>>> I created another module in Access (WLM32in64) because I have to hard code
    >>>>>>> the folder in the function
    >>>>>>> Declare Function MAPISendMail 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
    >>>>>>>
    >>>>>>> When I did this it works.
    >>>>>>>
    >>>>>>> What I have learned...
    >>>>>>> 1) the function must be called MAPISendMail.
    >>>>>>> 2) in Windows 7 the first and second attempt to send an email fail, the
    >>>>>>> third attempt succeeds. This happens only on the first attempt to send an
    >>>>>>> email with windows live mail and the MAPISendMail function. I have no idea
    >>>>>>> why.
    >>>>>>> Code to make sending mail work for the very first email sent.
    >>>>>>> MAPISendMail
    >>>>>>> If MAPIError then
    >>>>>>> MAPISendMail
    >>>>>>> if MAPIError then
    >>>>>>> MAPISendMail - the email is sent on the third attempt.
    >>>>>>> end if
    >>>>>>> end if
    >>>>>>>
    >>>>>>> What's strange is this, in Vista MAPISendMail has to try twice and in
    >>>>>>> Windows XP it works every time on the first attempt.
    >>>>>>> Remember, this is for the very first email being sent from MS Access upon
    >>>>>>> opening of the MS Access program. Once the first email attempt is complete,
    >>>>>>> every email after that works on the first attempt. No need to try two or
    >>>>>>> three times. That's just plain weird to me. But heck it works.
    >>>>>>>
    >>>>>>> I hope this helps someone else.
    >>>>>>>
    >>>>>>> If there is a better way to do this, I am very interested.
    >>>>>>>
    >>>>>>> Rick
     
    C C, Apr 20, 2011
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. 70f9
    Replies:
    0
    Views:
    325
  2. Replies:
    0
    Views:
    283
  3. Ildhund
    Replies:
    1
    Views:
    1,606
    Ildhund
    Jun 17, 2008
  4. thecreator
    Replies:
    0
    Views:
    517
    thecreator
    Jun 18, 2008
  5. TGL
    Replies:
    0
    Views:
    1,394
Loading...

Share This Page