F
Fercat
Hi,
Lurking trough newsgroups, I wrote an useful macro that, starting from an
Excel Db, permits me to email-merge with attachments:
Sub SendMail()
Dim Riga As Integer
Riga = InputBox("Inserisci la riga del Negozio dal quale vuoi iniziare
l'Email-Merge")
Range("A" & Riga).Select
Do Until ActiveCell.Value = ""
Dim ol As Object
Dim mailitem As Object
Set ol = CreateObject("Outlook.Application")
Set mailitem = ol.CreateItem(olMailItem)
With mailitem
.To = ActiveCell.Value
.CC = ActiveCell.Offset(0, 1).Value
.Subject = "Report number " & ActiveCell.Offset(0, 2).Value
.Body = "Buongiorno... "
.Attachments.Add (ActiveCell.Offset(0, 5).Value)
.Display
End With
SendKeys "%s"
Set ol = Nothing
Set mailitem = Nothing
ActiveCell.Offset(1, 0).Select
Loop
End Sub
Everything works really fine. Anyway, I'd like to add a Msgbox opening
simultaneously with the Displaying of the Email.
This should be a Yes-No MsgBox saying "Check the message. Do you want to
send it?"
I think it's a possible task but I don't know the code that allows it.
Can anybody help me?
Thanks to all!!!
Lurking trough newsgroups, I wrote an useful macro that, starting from an
Excel Db, permits me to email-merge with attachments:
Sub SendMail()
Dim Riga As Integer
Riga = InputBox("Inserisci la riga del Negozio dal quale vuoi iniziare
l'Email-Merge")
Range("A" & Riga).Select
Do Until ActiveCell.Value = ""
Dim ol As Object
Dim mailitem As Object
Set ol = CreateObject("Outlook.Application")
Set mailitem = ol.CreateItem(olMailItem)
With mailitem
.To = ActiveCell.Value
.CC = ActiveCell.Offset(0, 1).Value
.Subject = "Report number " & ActiveCell.Offset(0, 2).Value
.Body = "Buongiorno... "
.Attachments.Add (ActiveCell.Offset(0, 5).Value)
.Display
End With
SendKeys "%s"
Set ol = Nothing
Set mailitem = Nothing
ActiveCell.Offset(1, 0).Select
Loop
End Sub
Everything works really fine. Anyway, I'd like to add a Msgbox opening
simultaneously with the Displaying of the Email.
This should be a Yes-No MsgBox saying "Check the message. Do you want to
send it?"
I think it's a possible task but I don't know the code that allows it.
Can anybody help me?
Thanks to all!!!