General discussion

Locked

Emailing from Excel.

By matthew.done ·
Does anyone know some code for automatically emailing files to
people that are contained within a spreadsheet. ie the code should recurse
through the names pick up the first one send them the relevant file then
back to excel pick up the next nameand send it to the person. Any help
would be extremely helpful.

This conversation is currently closed to new comments.

12 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Emailing from Excel.

by Corky132 In reply to Emailing from Excel.

I dont believe it can be done in excel.. If you use SQL you can create a trigger and do sort of what you want.. however you lose the functionality of a spreadsheet...

Collapse -

Emailing from Excel.

by matthew.done In reply to Emailing from Excel.
Collapse -

Emailing from Excel.

by mcorr In reply to Emailing from Excel.

You can use the mail merge feature of Word to use the Excel spreadsheet as the source for your recipients. See the office help page titled "Use Microsoft Excel data as a mailing list in Word".

As far a doing it programmically, it is possible butdifficult. You could write a VBA program to make MAPI calls on a range of cells, but that may incur too much work. See Knowledge Base article Q180631 for information.

Collapse -

Emailing from Excel.

by matthew.done In reply to Emailing from Excel.
Collapse -

Emailing from Excel.

by msheehan In reply to Emailing from Excel.

Yes, this can be done with VB - its not too complicated, but far longer than will fit in this box.

Check out two books -
Programming Outlook and Exchange
Step by Step Visual Basic 6

Those will give you the foundation to write this program.

-Mike

Collapse -

Emailing from Excel.

by matthew.done In reply to Emailing from Excel.
Collapse -

Emailing from Excel.

by jmusgrov In reply to Emailing from Excel.

The DoCmd.SendObject command may be useful here. I used it in Access. Create variables for identifying the object to be sent and the recipient. Assuming the recipient name and file name are in rows, create a loop that starts at the first row, sets the variables to the cells' contents, executes the DoCmd and then moves to the next row.

Collapse -

Emailing from Excel.

by matthew.done In reply to Emailing from Excel.
Collapse -

Emailing from Excel.

by tclere In reply to Emailing from Excel.

If you use Outlook, it is a piece of cake.
Just add MS Outlook Object Library to your project references. I have an Excel application that I use to send update messages internal to our organization. Let me know if you need more help!


Public Type eMailInfo
sTo(6) As String
Subject As String
Message As String
End Type

Public eMail As eMailInfo

Public Sub SendMailMessage()
Dim olApp As Object, olItem As Object, i As Integer, sCCList As String
Set olApp = CreateObject("Outlook.Application")
Set olItem = olApp.CreateItem(olMailItem)
i = 0
Do While (Len(eMail.sTo(i))) > 0
olItem.Recipients.Add eMail.sTo(i)
i = i + 1
Loop
olItem.Subject = eMail.Subject
olItem.Body = eMail.Message
olItem.DeleteAfterSubmit = True
olItem.OriginatorDeliveryReportRequested = False
olItem.ReadReceiptRequested = False
olItem.Send
For i = 0 To 6: eMail.sTo(i) = "": Next i 'clear list of addresses
EndSub

Sub Main
'T

Collapse -

Emailing from Excel.

by matthew.done In reply to Emailing from Excel.
Back to Web Development Forum
12 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums