I have Outlook 2007, over windows XP SP3, and I developed the following code to create tasks and assign them to the people who helps me at work:
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.
Set myDelegate = oItems.Recipients.Add(StrDelegate)
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
Set oItems = Nothing
Set OutlookApp = Nothing
This code works all right, Can anybody help me to develop the VBScript code to automatically accept the task I send to my coworkers? I want to save time and work to my coworkers, accepting every task I assign them.