Outlook Object Model : Creating simple tasks programmatically using OOM & VBA?

In this post, we will create the simple Outlook tasks programmatically using Outlook Object Model API & VBA. We do this by using the code snippet:

 '[Code Snippet for creating Simple Tasks using Outlook Object Model API & VBA]
 Private Sub CreateTasks()
     'Declare the Task item
     Dim objTask As TaskItem
     ' Create Outlook Task item
     Set objTask = Application.CreateItem(olTaskItem)
     'Define its values
     objTask.Subject = "Test Item"
     objTask.Body = "Test task item"
     objTask.Importance = olImportanceNormal
     objTask.Status = olTaskNotStarted
     objTask.NoAging = True
     'Save the task
     MsgBox "Task Created"
     ' Clean up.
     Set objTask = Nothing
 End Sub