Microsoft Office Tutorials and References
In Depth Information
Sending a Message Individually to Multiple Recipients
End If¶
Next cll¶
'Clear email sent addresses¶
rng.Delete xlUp¶
'Reset email addresses range¶
Set rng = sht.Range(sht.Cells(2, 1), _¶
sht.Cells(65536, 1).End(xlUp))¶
'If there is only one row selected then¶
'there is no more email address to execute¶
If rng.Cells(1, 1).Row = 1 Then¶
'Stop Timer¶
Call KillTimer(True)¶
'Inform user about finalizing¶
MsgBox "Done!"¶
'Stop process¶
Exit Sub¶
End If¶
'Set next time to send next range of email addresses¶
'Using Send & Receive time that has been set in the¶
'declaration section¶
myRunTime = Now + TimeSerial(0, 0, myInterval)¶
Application.OnTime myRunTime, "SendEmail", , True¶
End Sub¶
' * * * * *¶
Sub KillTimer(Optional auto As Boolean)¶
'Stop timer¶
'continue when error occurs¶
On Error Resume Next¶
'Reset Status Bar message¶
Application.StatusBar = False¶
'Delete scheduled action on requested time¶
Application.OnTime myRunTime, "SendEmail", , False¶
'If user clicked on button to stop timer¶
'then auto variable will be false¶
'Confirm user about stopping timer¶
If Not auto Then MsgBox "Timer stopped"¶
End Sub¶
' * * * * *¶
Private Sub SetMailItem()¶
'Outlook Application Objects declaration¶
Dim objApp As Object 'Outlook.Application¶
Dim objFolder As Object 'Outlook.MAPIFolder¶
Dim objNS As Object 'Outlook.NameSpace¶
Dim retval¶
Dim i As Integer¶
Dim strItems As String¶
'Continue running when error occurs¶
On Error Resume Next¶
'Get running instance of Outlook Application¶
Set objApp = GetObject(, "Outlook.Application")¶
Search JabSto ::

Custom Search