Microsoft Office Tutorials and References
In Depth Information
Creating Task Items Automatically in Outlook
If olTask.Parent.Name = olNS.GetDefaultFolder(3).Name _¶
Then¶
'olFolderTasks = 13¶
olTask.Move _¶
olNS.GetNamespace("MAPI").GetDefaultFolder(13)¶
End If¶
End If¶
End If¶
End If¶
'Set error handler for general errors¶
On Error GoTo ErrHandler¶
'Make sure if Task Item has been set succesfully¶
If Not olTask Is Nothing Then¶
'Set Task Item properties by using current record data¶
With olTask¶
varShipDate = Me.ShipDate¶
.Subject = "Shipping for " & Me.PurchaseOrderNumber.Value¶
'Set Due Date for Task item specified days before¶
'the event date¶
.StartDate = varShipDate - RemindBefore¶
.DueDate = varShipDate - RemindBefore¶
'Set importance - High Importance¶
'Available options¶
''olImportanceHigh = 2¶
''olImportanceLow = 0¶
''olImportanceNormal= 1¶
.Importance = 2¶
'Set reminder for the requested day¶
'Time used by 13:00 as default¶
.ReminderSet = True¶
.ReminderTime = Format((varShipDate) & _¶
" 13:00", "mm/dd/yyyy hh:mm")¶
'Play a sound ?¶
.ReminderPlaySound = True¶
'Retrieve record information for current record¶
.Body = GetOrderInformation¶
'Save Task Item¶
.Save¶
'Save recently saved Task Item's unique EntryID¶
'to relate this Task Item and current record for¶
'later modifications¶
Me!OLTaskItemID = .EntryID¶
'Close Task Item by saving it¶
'Available options¶
'olSave = 0 'Required for silent automation¶
'olPromptForSave = 2¶
' olDiscard = 1 'Cannot be used for this code¶
.Close 0¶
End With¶
End If¶
Out
Search JabSto ::




Custom Search