+ Reply to Thread
Results 1 to 10 of 10

Creating an e-mail with an e-mail attachment

  1. #1
    Registered User
    Join Date
    06-09-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    20

    Creating an e-mail with an e-mail attachment

    Hi,

    I have used a macro that is able to send e-mails with data from an excel.

    Please Login or Register  to view this content.

    Instead of sending this e-Mail I want to attach this mail to another mail.
    Do you know, how to do this?

    Best
    pete

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Creating an e-mail with an e-mail attachment

    I think you just create another mail item and use the attachments.add method again? for example:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-09-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Creating an e-mail with an e-mail attachment

    I still do not have it.

    Do you mean like

    Please Login or Register  to view this content.
    Cheers
    Pete

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Creating an e-mail with an e-mail attachment

    I was thinking more along the lines of:
    Please Login or Register  to view this content.
    Edit: I just tried it quickly to check it works, you need to save the first email before attaching it otherwise the to/subject/bodyy fields go back to being blank., I've edited the code above as neccessary.
    Last edited by ragulduy; 06-24-2013 at 07:41 AM.

  5. #5
    Registered User
    Join Date
    06-09-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Creating an e-mail with an e-mail attachment

    That is exactly what I needed.

    I have one additional question. How can I save the e-mails as a .msg file? I tried
    Please Login or Register  to view this content.
    Directly after the . Display, but that did not work out. Do you know, how to do that?

    Cheers
    Pete

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Creating an e-mail with an e-mail attachment

    try
    Please Login or Register  to view this content.
    ?

  7. #7
    Registered User
    Join Date
    06-09-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Creating an e-mail with an e-mail attachment

    I have tried that directly after the .Display line but got an error.

    Do I need to put this somewhere else or is there something I can do about that?

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Creating an e-mail with an e-mail attachment

    No idea, it was just a guess. Daft question but are you actually using "Path\filename.msg" or are you changing Path for the actual path name?
    What is the error, thinking about it, if you are using olMSG and doing this from excel without a reference to outlook you need the constant as a number not olMSG. So you could try
    .SaveAs "path\filename.msg", 3

  9. #9
    Registered User
    Join Date
    06-09-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Creating an e-mail with an e-mail attachment

    Hi,

    I have tried
    Please Login or Register  to view this content.
    but sitll got the same problem. Is spaces in the path a problem?

    Cheers
    Hauke

  10. #10
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Creating an e-mail with an e-mail attachment

    Spaces in the path shouldn't be a problem. Out of interest what was the problem with this code:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1