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


                    Le Café Central de Deva              

                                 
                                 ..... Deva blogs!!




 

 

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

  • Comments 3

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
    objTask.Save
    MsgBox "Task Created"
      
    ' Clean up.
    Set objTask = Nothing
       
End Sub
  • That creates a task in outlook but how I create a task associate with the current contact...I mind that appears in the contact form.

    Thanks in advance.

  • I have a doubt that how we can create custom tab in outlook with VBA code.and where we write code.please sovle my problem if you have solution.Thank you in advance.

  • @RAM - Explain what you mean by custom tab? If you want to run the above macro then you need to make use of Outlook VBA Editor. Refer: msdn.microsoft.com/.../ee814736(v=office.14).aspx and www.slipstick.com/.../how-to-use-outlooks-vba-editor

Page 1 of 1 (3 items)
Blog - Post Feedback Form(CAPTCHA)
Leave a Comment
  • Post