tommygrayson
Jun 29th, 2006, 12:29 AM
Hi guys!!!!
Need help again in this one.
I have created a program that will e-mail calendar object automatically.
Fine I made it running and its okay but my only 1 tiny problem.
Macro takes too much CPU percentage.
How do I use the timer control in Outlook?
Thanks in advance.
By the way, here's my code:
Sub SMSMeeting()
Dim SMSApplication As New Outlook.Application
Dim SMSNS As Outlook.NameSpace
Dim SMSMailItem As Outlook.MailItem
Dim SMSCalendarItem As New Redemption.SafeAppointmentItem
Dim ReminderDate As String
Dim SMSDate As String
Dim PauseTime As Integer
Dim Test As String
Set SMSNS = SMSApplication.GetNamespace("MAPI")
Set SMSMailItem = SMSApplication.CreateItem(olMailItem)
ReminderDate = SMSApplication.Reminders.Item(1).OriginalReminderDate
SMSDate = DateAdd("h", -1, CDate(ReminderDate))
PauseTime = 10
Do While Not Timer >= Timer + PauseTime
DoEvents
If Now = SMSDate Then
SMSMailItem.To = "+639175319997@sms.dhl.com"
SMSMailItem.Body = "Test mail using program."
SMSMailItem.Subject = "Test Mail"
SMSMailItem.Send
End If
Loop
End Sub
Need help again in this one.
I have created a program that will e-mail calendar object automatically.
Fine I made it running and its okay but my only 1 tiny problem.
Macro takes too much CPU percentage.
How do I use the timer control in Outlook?
Thanks in advance.
By the way, here's my code:
Sub SMSMeeting()
Dim SMSApplication As New Outlook.Application
Dim SMSNS As Outlook.NameSpace
Dim SMSMailItem As Outlook.MailItem
Dim SMSCalendarItem As New Redemption.SafeAppointmentItem
Dim ReminderDate As String
Dim SMSDate As String
Dim PauseTime As Integer
Dim Test As String
Set SMSNS = SMSApplication.GetNamespace("MAPI")
Set SMSMailItem = SMSApplication.CreateItem(olMailItem)
ReminderDate = SMSApplication.Reminders.Item(1).OriginalReminderDate
SMSDate = DateAdd("h", -1, CDate(ReminderDate))
PauseTime = 10
Do While Not Timer >= Timer + PauseTime
DoEvents
If Now = SMSDate Then
SMSMailItem.To = "+639175319997@sms.dhl.com"
SMSMailItem.Body = "Test mail using program."
SMSMailItem.Subject = "Test Mail"
SMSMailItem.Send
End If
Loop
End Sub