Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Unanswered: using docmd.sendobject with Outlook 2003

    I'm using the docmd.sendobject command in MSAccess which works perfect for sending a Word document as an attachment for users which have Outlook 2000. But I get an error 2293 "Microsoft Access can't send this email message" for the users which have Outlook 2003. Microsoft has apparently changed some things with Outlook security and attachments for 2003.

    Does anyone know of a quick easy fix for this? I've researched Microsoft's website and they get into some detailed things I'm not sure on.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I don't remember the specific fix for this but I do know there is some security deal in 2k3 where you have to allow access to your mailbox from third party applications for a finite window of time. I get that message when I run an access-based archive tool that pulls email from outlook to an external db.

    So no, you're not crazy. Unfortunately I don't remember the specific issue at hand.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Thanks for the quick response Teddy. I'm finding it difficult to believe that there isn't an easy fix for this since it's a Microsoft Word Document in a Microsoft Outlook email. It seems to me that crippling the docmd.sendobject command for Access if a user upgrades to Outlook 2003 would have a lot of vba programmers screaming.

    Microsoft says to switch to Outlook verses Outlook Express but I am already using Outlook and not Outlook Express.


    There's got to be an easy fix for this.
    Last edited by pkstormy; 08-06-07 at 14:32.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Got it. It seems that if I leave some of the options blank without the "" (this is old code), it gives me an error whereas if I don't, it gives me the "A program is trying to send an attachment on your behalf - do you want to allow this":

    For example, this:
    DoCmd.SendObject acReport, "testreport", , , , , , False

    returns an error whereas this:

    DoCmd.SendObject acReport, "testreport", , "<email address>", "", "", "This is a test", "", False, ""

    Prompts for the "Do you want to send this?" message which I can live with.

    Also this:
    DoCmd.SendObject acReport, "testreport", , "<email address>", "", "", "This is a test", "", True, ""

    gives me an error so it might also be something with the Edit Message option set to True. I'll do some more digging.
    Last edited by pkstormy; 08-06-07 at 16:40.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Ok, it's definately something with the Edit Message option.

    This works:

    DoCmd.SendObject acReport, "testreport", , "<email address>", "", "", "This is a test", "", False, ""

    Whereas this doesn't:

    DoCmd.SendObject acReport, "testreport", , "<email address>", "", "", "This is a test", "", True, ""
    Last edited by pkstormy; 08-06-07 at 16:33.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Here's what I found with the docmd.sendobject command. User XXXX is using Outlook 2003. Outlook 2003 has changed their security for sending emails with an attachment. For vba code, the docmd.sendobject command cannot be utilized with the Edit Message set to True and the "TO" left blank. A "TO" must be supplied and the Edit Message must be set to "False" in the vba code (at least to my knowledge so far).
    Once these parameters are supplied in the vba command and a user clicks on the button to send the attachment, a message box will appear stating to the effect: "A program is trying to send an attachment on your behalf. Do you want to allow this?" and a progress bar appears. Once the progress bar has reached the end, the Yes box is enabled where the user must click Yes in order to complete the email.

    For example, this (where me!EmailTo = the email address):

    DoCmd.SendObject acReport, stDocName, "RichTextFormat(*.rtf)", Me!EmailTo, "", "", "Some message", "", True, ""

    will give the error 2293

    whereas this:

    DoCmd.SendObject acReport, stDocName, "RichTextFormat(*.rtf)", Me!EmailTo, "", "", "Some Message", "", False, ""

    does not.

    Oh, and this issue seems to be Outlook service pack related.
    Last edited by pkstormy; 08-06-07 at 17:30.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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