Results 1 to 15 of 15
  1. #1
    Join Date
    Jan 2004
    Posts
    77

    Unanswered: Macro to SendObject via Distribution List

    I have a form with a command button that runs a SendObject macro which automatically sends a report via email to select recipients via an Outlook Distribution List. It works great on Win2K but bombs on WinXP with an Action Failed box. The only option is Halt - pressing halt, returns “Unknown message recipients; the message was not sent”. If I hard code in each separate email address in the To: control of the macro, it works fine. However, the recipients change periodically. I don’t want the users to dabble in the macro code. I’d rather they only deal with the Distribution List.

    Any suggestions would be greatly appreciated.

    Thanks,
    SKK

  2. #2
    Join Date
    Aug 2006
    Posts
    559
    What about separate distribution lists or allowing the user to add a single recipient with a baseline of distribution lists? For example, list all the people in HR in a single distribution list (HR_List), then the user can select that list and add in individuals who are not in that list they want the email to go to?

  3. #3
    Join Date
    Jan 2004
    Posts
    77
    That's exactly what I tried. However, it bombs on any DistList (ours is called "Incident"). This way they can add/delete persons to the Incident list without getting into the code.

    Thanks,
    SKK

  4. #4
    Join Date
    Aug 2006
    Posts
    559
    That's my fault, I should have read more closely. I believe, not sure cause I got a new job and left the DB at the old one, but the DB I had did something similar to what you're asking. However, I could not automatically add a DL list (the machines were also on XP Pro and Office 2k3. When it went to Outlook to send it, the user can select their own DLs that they created, or add individuals, or select a DL list that was created by the Exchange Admin.

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Grafixx01 - are you referring to the Task Tracker program you developed? If you need copies of it, I have a few of the revisions you uploaded.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    [sarcasm]Update your version of Windows today, lose functionality now! Just wait and see what we've removed in the new Windows Vista!![/sarcasm]

    An ugly workaround is to have users define the distribution list in Access and have the code use the names in the list to send to.

    Better is to use the DLs in Outlook, but as you said, that doesn't seem to work :/ I'm at a bit of a loss to understand why it doesn't work though, it might be as simple as needing quotes around it or something... what code are you using to send the mail?

    When you create a mail object (without actually sending it), does the e-mail appear with the distribution list in it or doesn't it get that far?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  7. #7
    Join Date
    Jan 2004
    Posts
    77
    I'm sending this via a macro. Maybe this would work better coding with VBA but I'm not a programmer (maybe you could assit).

    My macro:
    Action = SendObject
    Object Type = Report
    Object Name = rptIncident
    To = Incident (this is the distribution list name)
    Subject = Bridge Incident
    Message = Please review attached incident report...
    Edit Message = No


    Thanks,
    SKK

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Right click the macro > save as > module

    May be useful to see the VBA code generated from this too.
    George
    Home | Blog

  9. #9
    Join Date
    Jan 2004
    Posts
    77
    Excellent. I never know that option existed. I'll play with this a bit.

    Thanks again,
    SKK

  10. #10
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Yes, VBA will give you MUCH more flexibility, well worth learning

    Let's hope you find a way to use your outlook DL :w00t:
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  11. #11
    Join Date
    Jan 2004
    Posts
    77
    Aha...
    I think found it. We use a Personal Address Book. If I put the DL in Contacts it works fine (why PAB works in Win2K - who knows).

    Thanks again everyone for your help...
    SKK

  12. #12
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Same version of Outlook on both WinXP and Win2K?

    Glad you found it
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  13. #13
    Join Date
    Jan 2004
    Posts
    77
    Yup.
    Thanks again...

  14. #14
    Join Date
    Aug 2006
    Posts
    559
    But as far as I know, even if you're using the same version on the local machines, you have to check if they upgraded your Exchange server version. We had to recreate ALL of the 300+ DLs at my last job because they didn't transfer over when we went from Exchange Server 5.5 to Exchange Server 2007. **And YES, we did do the versions in between** Just somewhere along the way, they crapped out.

  15. #15
    Join Date
    Jan 2004
    Posts
    77
    OK Thanks...

Posting Permissions

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