VBA/Excel/Access/Word/Outlook/Outlook Task
Содержание
Assigning a Task to a Colleague
Sub taskItemTask()
Dim myTaskAssignment As TaskItem
Set myTaskAssignment = Application.CreateItem(ItemType:=olTaskItem)
With myTaskAssignment
.Assign
.Recipients.Add Name:="Your Name"
.Subject = "Body"
.Body = "body."
.DueDate = Str(Date + 3)
.Send
End With
End Sub
Create a TaskItem
Sub taskItem()
Dim myTask As TaskItem
Set myTask = Application.CreateItem(ItemType:=olTaskItem)
With myTask
.Subject = "plan"
.Body = "body"
.DueDate = Str(Date + 28)
.Status = olTaskInProgress
.PercentComplete = 10
.rupanies = "your company"
.BillingInformation = "Sales & Marketing"
.Importance = olImportanceHigh
.Save
End With
End Sub
Creating a Task
Sub task()
Dim myTask As TaskItem
Set myTask = Application.CreateItem(ItemType:=olTaskItem)
End Sub
Using the Save Method
"Creates a new task; assigns it a subject, start date, and due date; turns off the reminder for the task; and then saves it:
Sub taskItem()
Dim myTask As TaskItem
Set myTask = Application.CreateItem(ItemType:=olTaskItem)
With myTask
.Subject = "Arrange Review Meeting"
.StartDate = Date
.DueDate = Date + 7
.ReminderSet = False
.Save
End With
End Sub