Sub CreateTaskItem(strSubject,strDueDate,strBody,StrDelegate,strCategory,intID) Const olTaskItem = 3 'Creates an Automation object of the specified class Set OutlookApp = CreateObject("Outlook.Application") 'Creates and returns a new Microsoft Outlook item (item: An item is the basic element that holds information in Outlook) Set oItems = OutlookApp.CreateItem(olTaskItem) 'Assigns a task and returns a TaskItem object that represents it. 'This method allows a task to be assigned (delegated) to another user. 'You must create a task before you can assign it, and you must assign a task before you can send it. 'An assigned task is sent as a TaskRequestItem object. oItems.Assign Set myDelegate = oItems.Recipients.Add(StrDelegate) myDelegate.Resolve If myDelegate.Resolved Then 'String indicating the subject for the Outlook item oItems.Subject = strSubject 'Date indicating the due date for the task oItems.DueDate = strDueDate 'String representing the clear-text body of the Outlook item oItems.Body = strBody 'String representing the categories assigned to the Outlook item oItems.Categories = strCategory 'String representing the names of the companies associated with the Outlook item. In this code, Categories info is saved. oItems.Companies = strCategory 'String representing the billing information associated with the Outlook item. In this code is used to assing and unique ID to this Task oItems.BillingInformation = CStr(intID) 'String representing the mileage for an item. Read/write. oItems.Mileage = "CRCD Guadalupe" 'Occurs when the user selects the Send action for an item, or when the Send method is called for the item, which is an instance of the parent object oItems.Send End If Set oItems = Nothing Set OutlookApp = Nothing End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.