M
Mr . .
I'd like to send an email weekly at a certain time. I've been searching
around on the web and found a post with the following text/code.
Can someone expound a bit for me? is the "ThisOutlookSession" the name of a
macro? What about the "public / private"?
Question: How can you get VBA in outlook to send a message on a daily or
weekly basis?
Thanks To andrzej and www.outlookvba.com for this answer!
Set up a folder in your inbox called News Put your email in here
Set a recuring appointment in the calender with the subject new, to recur
when you want the email sent also set a reminder.
in ThisOutlookSession add the following:
Public WithEvents myOlItems As Outlook.Items
Private Sub Application_Reminder(ByVal Item As Object)
'wait for reminder
If Item.Sensitivity <> olConfidential Then
If TypeOf Item Is AppointmentItem Then SendApptReminder Item
End If
End Sub
Private Sub SendApptReminder(ByRef Item As AppointmentItem)
'Test the Subject of Reminder
If Item.Subject = "news" Then sendpage2 Else
End Sub
'Send news letter
Private Sub sendpage2()
Set ol = New Outlook.Application
Set olns = ol.GetNamespace("MAPI")
Set MyInboxFolder = olns.GetDefaultFolder(olFolderInbox)
Set myNewsletter = MyInboxFolder.Folders("News")
Then
Set mynews = myNewsletter.Items(1)
mynews.send
End Sub
around on the web and found a post with the following text/code.
Can someone expound a bit for me? is the "ThisOutlookSession" the name of a
macro? What about the "public / private"?
Question: How can you get VBA in outlook to send a message on a daily or
weekly basis?
Thanks To andrzej and www.outlookvba.com for this answer!
Set up a folder in your inbox called News Put your email in here
Set a recuring appointment in the calender with the subject new, to recur
when you want the email sent also set a reminder.
in ThisOutlookSession add the following:
Public WithEvents myOlItems As Outlook.Items
Private Sub Application_Reminder(ByVal Item As Object)
'wait for reminder
If Item.Sensitivity <> olConfidential Then
If TypeOf Item Is AppointmentItem Then SendApptReminder Item
End If
End Sub
Private Sub SendApptReminder(ByRef Item As AppointmentItem)
'Test the Subject of Reminder
If Item.Subject = "news" Then sendpage2 Else
End Sub
'Send news letter
Private Sub sendpage2()
Set ol = New Outlook.Application
Set olns = ol.GetNamespace("MAPI")
Set MyInboxFolder = olns.GetDefaultFolder(olFolderInbox)
Set myNewsletter = MyInboxFolder.Folders("News")
Then
Set mynews = myNewsletter.Items(1)
mynews.send
End Sub