Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Emailing from Access (2000)

    Hi and Happy New Year,
    I have the following code. I'm trying to email a report and I have tested the code with one email and one CC email and it worked great. Now I want to add about 5 CC emails and I'm not sure of the syntax. I can't get it to work. Any help would be appreciated.
    Thanks,
    Deb
    Private Sub cmdSendReceiveReport_Click()
    DoCmd.SendObject acSendReport, "rptReceivingReport", acFormatSNP, _
    "william.carlson@dla.mil",*the following are the emails I want CC*"carl.wevodau@dla.mil,charles.lingle@dla.mil," _
    "brad.rice@dla.mil,kimberly.fisher@dla.mil,debra.k .smith@dla.mil", _
    "Recieved Parts Report Attached", _
    "Attached is the receiving report."
    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Emailing from Access (2000)

    Try using the semi-colon as separator, e.g.
    <code>"carl.wevodau@dla.mil;charles.lingle@dla.mil "</code>

  3. #3
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Emailing from Access (2000)

    Ok, a comma works, I think what my problem is, I have 5 email addresses that I want in the CC section, when I type them in it makes the line of code really long, so I want to bring the last 3 down onto the next line so I don't have to scroll left or right, I think that's the syntax that I have wrong. Here's the code that works.
    Private Sub cmdSendReceiveReport_Click()
    DoCmd.SendObject acSendReport, "rptReceivingReport", acFormatSNP, _
    "william.carlson@dla.mil", "carl.wevodau@dla.mil,charles.lingle@dla.mil,debra .k.smith@dla.mil,kimberly.fisher@dla.mil", , _
    "Recieved Parts Report Attached", _
    "Attached is the receiving report."
    End Sub

    Thanks,Deb

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Emailing from Access (2000)

    Say that you wanted to break the CC part. You must put quotes around both parts, and concatenate them with &:
    <code>
    DoCmd.SendObject acSendReport, "rptReceivingReport", acFormatSNP, _
    "william.carlson@dla.mil", "carl.wevodau@dla.mil,charles.lingle@dla.mil," & _
    "debra.k.smith@dla.mil,kimberly.fisher@dla.mil ", , _
    "Received Parts Report Attached", _
    "Attached is the receiving report."
    </code>
    It is important that there is an ampersand & followed by a space and an underscore _ at the end of the line with the first CC part.

  5. #5
    4 Star Lounger
    Join Date
    Oct 2002
    Location
    Sayre, Pennsylvania, USA
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Emailing from Access (2000)

    Thanks, that did it.
    <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>
    Thanks,
    Deb

Posting Permissions

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