Solved

Duplicate Outlook 2007 "New Task For Contact" Functionality In VBA

Posted on 2014-03-23
2
409 Views
Last Modified: 2014-03-24
When a user right-clicks a Contact in Outlook 2007, then clicks "Create," they can click the option of "Create New Task For Contact" to create a new task for the Contact.  This is VERY convenient because in addition to creating the new Task, the Task is also automatically linked to the Contact (see bottom left corner of the new Task to the right of the "Contacts ..." button).

I need to create this functionality using VBA.  In addition to this functionality I also need to set the value for several of the new Task's fields using the same VBA code (e.g., Subject, Start Date, etc.).  I am an experienced Excel VBA user and I understand the object model fairly well.  Does anyone have any ideas how I might code this functionality?

Thanks,

Bill Vallance
0
Comment
Question by:bvallanc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39949863
Hi,

pls try

Sub Test()
Dim objOutlook As New Outlook.Application
Dim objTask As Outlook.TaskItem
Set objTask = objOutlook.Session.GetDefaultFolder(olFolderTasks).Items.Add

objTask.Recipients.Add "FirstName LastName"
objTask.ContactNames = "ContactName"
objTask.Subject = "Subj"
objTask.Body = "Test Body"
objTask.DueDate = Now() + 1
objTask.Assign
objTask.Send
objTask.Close olSave
End Sub

Open in new window

Regards
0
 

Author Closing Comment

by:bvallanc
ID: 39950815
Perfect!  Thanks Rgonzo1971 for the quick response.  This worked perfectly.

Bill Vallance
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question