Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Los Angeles
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sendobject (VBA/Access2000/sr1)

    I am using docmd.sendobject in VBA on an Access form to send an email via Outlook 2000.
    It works PERFECTLY! The only problem is that it only works ONE TIME. Sometimes it works 2 or 3 times, but I can't determine a pattern or reason for this.

    Here is the code I am using:

    Private Sub Command36_Click()
    DoCmd.SendObject acSendNoObject, , , [Members], , , "New Resident Complaint", "COMPLAINT: " & [ComplaintDescription] & "Last Name " & [ConLastName] & "DATE RECEIVED: " & [ComplaintReceivedDate], True, ""

    End Sub

    Is there some line of code that would "clear" or "reset" some dll or something that is running in Outlook?
    I don't really know VBA, I'm just hacking around here. I'm hoping it is a simple line or two. THANK YOU!

  2. #2
    New Lounger
    Join Date
    Feb 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sendobject (VBA/Access2000/sr1)

    hi,

    i have no solution to your current problem,
    but i stopped using sendobject a long time ago.

    I now use the Outlook object library, and that one always works
    Here is an example:

    '************************************************* ************
    '* Set a reference to 'Microsoft Outlook 9.0 Object Library *
    '* (or any other version) *
    '* Menu 'Tools', 'References', check the appropriate library *
    '************************************************* ************

    Private Sub cmdSendMail_Click()
    Dim ol As New Outlook.Application
    Dim olMail As Outlook.MailItem
    Dim strCC As String

    'strCC = "address1@domain.com" & ";" & "address2@domain.com"


    Set olMail = ol.CreateItem(olMailItem)

    With olMail
    .To = "some.address@domain.com"
    '.CC = strCC
    '.BCC = "address2@aa.com"
    '.Attachments.Add "c:somefile.txt"
    '.Attachments.Add "c:anotherfile.txt"
    .Subject = "Testing"
    .Body = "This is the body..."
    .Display
    '.Send
    End With

    Set olMail = Nothing
    Set ol = Nothing

    End Sub

    btw, make sure u
    cheers
    Ricky

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    Los Angeles
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sendobject (VBA/Access2000/sr1)

    THANK YOU THANK YOU THANK YOU!!
    That sendobject was going to be the end of me. Works like a charm every time.

  4. #4
    New Lounger
    Join Date
    Jan 2001
    Location
    Maryland, USA
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sendobject (VBA/Access2000/sr1)

    Hi,

    I know this is an old thread, but I was wondering how to insert a mailmerge document as the body of the email (not as an attachment). When I use the code you provided, I only get the document name as the body. Hope you can help!

    Thanks,
    Lisa

Posting Permissions

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