Hi
In my Human resources system the user can add a task in Outlook 2010.
The code is :
Function fncAddOutlookTask()
Dim OutlookApp As Object
Dim OutlookTask As Outlook.TaskItem
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
With OutlookTask
.Subject = Me.Subject & " " & "IDnr" & Me.Idnr
.Body = Me.Body & " "
.ReminderSet = True
.ReminderTime = DateAdd("n", 2, Me.Reminder1 & " " & Me.Reminder2)
.DueDate = DateAdd("n", 5, Me.Due & " " & Me.Due2)
.ReminderPlaySound = True
.ReminderSoundFile = "C:\Windows\Media\ringout.wav"
.Save
End With
End Function
When outlook is open everything works just fine. When Outlook is closed
it doesn't open Outlook but produces the following message:
The reminder for "whatever" will not appear because the item
is in a folder that doesn't support reminders. Is this ok? Yes/ No
On YES the reminder is added, but on NO i get :
Run time error
Cannot save this item.
It is just a bit annoying, i could live with it but any advice about how to fix this would be appreciated.
Balder
Norway
In my Human resources system the user can add a task in Outlook 2010.
The code is :
Function fncAddOutlookTask()
Dim OutlookApp As Object
Dim OutlookTask As Outlook.TaskItem
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookTask = OutlookApp.CreateItem(olTaskItem)
With OutlookTask
.Subject = Me.Subject & " " & "IDnr" & Me.Idnr
.Body = Me.Body & " "
.ReminderSet = True
.ReminderTime = DateAdd("n", 2, Me.Reminder1 & " " & Me.Reminder2)
.DueDate = DateAdd("n", 5, Me.Due & " " & Me.Due2)
.ReminderPlaySound = True
.ReminderSoundFile = "C:\Windows\Media\ringout.wav"
.Save
End With
End Function
When outlook is open everything works just fine. When Outlook is closed
it doesn't open Outlook but produces the following message:
The reminder for "whatever" will not appear because the item
is in a folder that doesn't support reminders. Is this ok? Yes/ No
On YES the reminder is added, but on NO i get :
Run time error
Cannot save this item.
It is just a bit annoying, i could live with it but any advice about how to fix this would be appreciated.
Balder
Norway