Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Feb 2008
    Posts
    1,420
    Thanks
    124
    Thanked 5 Times in 5 Posts

    Set email address in Cell

    I would like to amend my code below so that the email address/addresses can refer to a cell/s on sheet2

    My full code runs perfectly, but just need this change

    Code:
     If FileName <> "" Then
                RDB_Mail_PDF_Outlook FileNamePDF:=FileName, _
                                      StrTo:="dave.peter@xxx.com", _
                                      StrCC:="martin.smith@xxx.com", _
                                     StrBCC:="", _
                                     StrSubject:="Management accounts", _
                                     Signature:=True, _
                                     Send:=False, _
                                     StrBody:="<H3><B>Dear Dave</B></H3><br>" & _
                                              "<body>See Attached Management accounts in PDF." & _
                                              "<br><br>" & "Regards</body>"
            Else

  2. #2
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 985 Times in 915 Posts
    I'd set the values early in the code.
    StrToAddr = range("E1").value
    StrCCAddr = range("E2").value

    For the email it's:
    StrTo:=StrToAddr
    StrCC:=StrCCAddr

    I think the code is correct, don't have Excel to test.

    cheers, Paul

  3. #3
    Bronze Lounger
    Join Date
    Feb 2008
    Posts
    1,420
    Thanks
    124
    Thanked 5 Times in 5 Posts
    Hi Paul

    Thanks very much

    I just added statement to declare the variables

    It is working perfectly

Posting Permissions

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