Consulting

Results 1 to 2 of 2

Thread: Lotus Notes and Access

  1. #1
    VBAX Regular
    Joined
    Oct 2008
    Posts
    69
    Location

    Lotus Notes and Access

    I am trying to automatically email from a database - but we use Lotus Notes as an email client...they don't seemt o play together well...

    Any thoughts on how to get Access to use LN rather than looking for an MS product to email a report would be greatly appreciated!

  2. #2
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,676
    Location
    If Lotus Notes is set as your computer's default e-mail application, then you can use the MailTo method. This creates an e-mail by launching the default e-mail app. I can't test it against Lotus Notes, but it should work.

    This is some pretty advanced code- it makes use of the WIN API ShellExecute() method.

    to send the emial you need to call the SendEmail sub and provide values for the parameters. Here's an example of how to call the sub:

    SendEmail "you@hotmail.com", "This is the subject line", "This is the e-mail body."

    [vba]Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
    ByVal hWnd As Long, _
    ByVal lpOperation As String, _
    ByVal lpFile As String, _
    ByVal lpParameters As String, _
    ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long
    Private Const SW_SHOW As Long = 5

    Sub SendEmail(strTo As String, strSubject As String, strBody As String)
    Dim rc As Long
    Dim strFile As String
    'build the lpFile argument
    strFile = "Mailto:" & strTo
    strFile = strFile & "?subject=" & strSubject
    strFile = strFile & "&body=" & strBody
    rc = ShellExecute(0, "open", strFile, "", "", SW_SHOW)
    End Sub[/vba]

    There are probably other ways to accomplish this that I am not aware of.

    HTH
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •