Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Community Wiki

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Navigation

Google Ads

Create and Assign Outlook Task

From Wiki

Jump to: navigation, search

In order to assign a task in Outlook, you must first log on.

Example: Assign a task

  Sub CreateTask()
  'Requires reference to the Microsoft Outlook x.x Object Library
   
  Dim oApp As New Outlook.Application
  Dim oTask As Outlook.TaskItem
  Dim AssignedTo As Outlook.Recipient
  Dim oNS As Outlook.NameSpace
   
      Set oApp = CreateObject("Outlook.Application")
   
      'Logon on
      Set oNS = oApp.GetNamespace("MAPI")
      oNS.Logon
   
      Set oTask = oApp.CreateItem(olTaskItem)
   
      oTask.Assign
      Set AssignedTo = oTask.Recipients.add("a@b.c")
      oTask.Subject = "A task has been assigned to you."
      oTask.Body = "Do something."
      oTask.DueDate = Now
      oTask.Importance = 2 'olImportanceHigh
      oTask.ReminderSet = True
      'oTask.Save
   
      'Pick Display or Send
      oTask.Display
      'OutlookTask.Send
   
      'Clean up
      Set oTask = Nothing
      oApp.Quit
      Set oApp = Nothing
   
  End Sub

Further Information

Assign Method: http://msdn2.microsoft.com/en-us/library/aa220073(office.11).aspx

409 Rating: 1.0/5 (2 votes cast)