+ Reply to Thread
Results 1 to 4 of 4

How to attach a local file to email using macro?

  1. #1
    Registered User
    Join Date
    07-28-2004
    Posts
    5

    How to attach a local file to email using macro?

    Hello Expert out there,

    I'm asking if anyone of you would asisst me with my problem. I am trying to figure out how to write the VBA scripts to attach a file (SPICK.xls) in C:\temp folder to email such as Lotus Notes. This will save me work of clicking steps on email in order to send the file out.

    Appreciate your help.

    Thanks.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Tanks1308,

    To send an Email attachment from Excel using VBA and Lotus Notes as your Email client, have a look at this site. It has the code and explains what to change with regard to different versions of Notes.

    http://www.fabalou.com/VBandVBA/lotusnotesmail.asp

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    07-28-2004
    Posts
    5
    Hello Ross,

    thanks for the input. But I've tried it, it still did not work out. Maybe I've tried that in a wrong way.

    I have extracted some code, this code helps but not to solve my problem.

    Sub Mail_ActiveSheet()
    Dim strDate As String
    ActiveSheet.Copy
    strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss")
    ActiveWorkbook.SaveAs "Spick " & ThisWorkbook.Name _
    & " " & strDate & ".xls"
    ActiveWorkbook.SendMail "[email protected]", _
    "Spick file as of " & Format(Date - 1, "mm-dd-yyyy")
    ActiveWorkbook.ChangeFileAccess xlReadOnly
    Kill ActiveWorkbook.FullName
    ActiveWorkbook.Close False
    End Sub

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Tanks1308,

    From these 2 posts it really isn't clear me what you want to do. What program does your system use to send Email? Lotus Notes, Outlook Express, Outlook, Eudora, or are you simply wanting to use the Excel SendMail?

    Sincerely,
    Leith Ross

+ 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