Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending mail with excel via netscape

Status
Not open for further replies.

denis60

Technical User
Apr 19, 2001
89
CA
Hi!
I did a program with excel and i want to send mail automatically by netscape (no choice) to tell if the program fail or not. I know about mapi32 and shell but i am a beginner. Is someone can help me ???
 
This routine will look at 3 cells within Excel and send a message with an attachment. Sorry, I don't know how to send just a message, but sending a blank xls file is no big deal.

C5=Full email address (JohnSmith@msn.com)
C6=Full path to file attachment (C:\Temp\Blank.xls)
C7=Text message (The routine ran OK) or (Something wrong)
You can create a formula that states what you want.

--------------------------------------------------------
Sub EMailFile()
Application.ScreenUpdating = False ' smooth out macro execution
Range("C5").Select ' Start here, where C5=MailWho, C6=MailFile, C7=MailMessage

MailWho = Selection.Range("A1") ' get WHO value from current cursor cell
MailFile = Selection.Range("A2") ' get FILE from current cell + 1 row down
MailMessage = Selection.Range("A3") ' get MESSAGE from current cell + 2 rows down

Workbooks.Open FileName:=MailFile, ReadOnly:=True, UpdateLinks:=0 ' Open the file
ActiveWorkbook.SendMail Recipients:=MailWho, Subject:=MailMessage ' Send it
ActiveWorkbook.Close (False) ' Close and NO SAVE !


Windows("MasterFile.xls").Activate 'Now go back to Main file
End Sub
--------------------------------------------------------


I wasn't sure what you mean by "Netscape (no choice)", but I think the above routine will work with whatever has been set as your default Email.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top