Hi, I wonder whether someone may be able to help me please.
Firstly, my apologies this is my first Outlook macro, so it may contain many errors.
But, I'm trying to create a recurring Task which I will send to other users via email with the following schedule:
- Starting today i.e the 15/11/13
- Send the reminder on the following Monday at 9.00am
'****Create a task in users Tasks Development****
Public WithEvents myOlApp As Outlook.Application
Private Sub Application_Startup()
Initialize_handler
End Sub
Public Sub Initialize_handler()
Set myOlApp = CreateObject("Outlook.Application")
End Sub
Private Sub myOlApp_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim intRes As Integer
Dim strMsg As String
Dim objTask As TaskItem
Set objTask = Application.CreateItem(olTaskItem)
Dim strRecip As String
strMsg = "Do you want to create a task for this message?"
intRes = MsgBox(strMsg, vbYesNo + vbExclamation, "Create Task")
If intRes = vbNo Then
Cancel = False
Else
For Each recipient In Item.Recipients
strRecip = strRecip & vbCrLf & recipient.Address
Next recipient
With objTask
.RecurrenceType = olRecursWeekly
.DayOfWeekMask = olMonday
.StartDate = #11/15/2013 2:00:00 PM#
.Interval = 1
.ReminderSet = True
.ReminderTime = DayOfWeekMask + #9:00:00 AM#
.Body = strRecip & vbCrLf & Item.Body
.Subject = Item.Subject
.Save
End With
Cancel = False
End If
Set objTask = Nothing
End Sub
The problem I have is that when I try to run this I receive the following: 'Run time error '483' Object doesn't this property or method' and Debug highlights this row as the cause:
.RecurrenceType = olRecursWeekly
I just wondered whether someone could possibly look at this please and let me knwo where I've gone wrong.
Many thanks and kind regards
Bookmarks