Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Add Outlook task item

Posted on 2006-07-15
6
Medium Priority
?
747 Views
Last Modified: 2010-04-05
I am using ms outlook 2003. I want my application to create outlook tasks automatically, based on the dates in my database and assign tasks to contact in my contacts folder. How can I achieve this?

Thanks
0
Comment
Question by:drnadeem
[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
  • 3
  • 2
6 Comments
 
LVL 1

Author Comment

by:drnadeem
ID: 17119871
POints are going up
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 17119957
http://www.add-in-express.com/

There you can purchase a component set that should help you to include task items into Outlook. They also offer you a solution to bypass the Outlook security, which you will need when using Outlook 2003.
0
 
LVL 1

Author Comment

by:drnadeem
ID: 17120431
I am not trying to develop an add in, but rather automate outlook to add a new task via my program.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 26

Accepted Solution

by:
Russell Libby earned 2000 total points
ID: 17154677

Adding the task request is a pretty simple deal, eg (include ComObj, ActiveX in uses):

var  ovOutlook:     OleVariant;
     ovItem:        OleVariant;
begin

  ovOutlook:=CreateOleObject('Outlook.Application');
  try
     ovItem:=ovOutlook.CreateItem(3);
     try
        ovItem.Recipients.Add('foo@bar.net');
        ovItem.Subject:='Prepare Agenda For Meeting';
        ovItem.DueDate:='7/22/2006';
        ovItem.Assign;
        ovItem.Send;
     finally
        ovItem:=Unassigned;
     end;
  finally
     ovOutlook.Quit;
     ovOutlook:=Unassigned;
  end;

end;

The problem comes from Outlooks security model kicking in. As soon as you set do anything related to emailing (and no UI is being displayed), then Outlook kicks up dialogs to the user indicating that a script is trying to automate such and such. If your ok with that, then the task should be straightforward.

If this isn't ok, I can tell you what needs to be done, but without all the tools (difficult to come by) it will be a headache.

- If an application has been digitally signed (even self signed), then Outlook can import the certificate, allowing the application to automate Outlook without the security warnings. In the "C:\Program Files\Microsoft Office\OFFICE11" folder a program called selfcert.exe can be found, which will allow you to create a self signed cert. I know on my old Delphi 3 Ent, I had the signcode.exe program that you will need to get hold of in order to digitially "sign" your exe application. For VB, the task seems much easier as they the tools readily available.

http://www.microsoft.com/technet/prodtechnol/office/office2000/maintain/security/vbamacro.mspx

Anyways, once signed, the private cert can be imported into Outlook, which will then let your program run unhindered.

Regards,
Russell







0
 
LVL 1

Author Comment

by:drnadeem
ID: 17162915
Russel,
Your example works fine. One little thing though:

When I use

ovItem.Reminderdate := '7/23/2006'

I get error message Method 'ReminderDate' not allowed?
Any way I can add a reminder date to the task?
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 17167952

There seems to be a little confusion...
First, the ReminderTime (eg '7/28/2006 08:00AM') is the property that needs to be set, along with ReminderSet:=True. But this is only supported if you are creating a task for yourself. (eg, no recipients / no Assign). Its an either / or situation. If you wish to visually see the logic, go into Outlook and create a new task. You will notice that you can set the reminder date/time, but notice what happens when you click the assign button.

Regards,
Russell
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

705 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