Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 15th, 2004, 08:51 AM
vp123 vp123 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 vp123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 12 sec
Reputation Power: 0
Question Creating Tasks in Exchange Server 2003

Hi All,
I have been really struggling to find out how to carry out some basic tasks in exchange server , having a rdbms background

Some besic queries if anyone can help me out with code samples.

I need to create an exe(which can be in vb or vb.net) which will need to do below mentioned tasks from a different machine other than the one holding the exchange server.

1) How to connect to exchange server database?

2) How to add microsoft outlook tasks for particular user, so that if he opens his mailbox he can see the list of tasks? tasks are retrieved from an oracle table

I am also unable to find any documentation and code samples on microsoft outlook tasks as far as urn schemas and properties are concerned.

Waiting for some really helpful response from the group.

Thanks & Regards
-Varun

Reply With Quote
  #2  
Old September 16th, 2004, 01:25 AM
vp123 vp123 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 vp123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 12 sec
Reputation Power: 0
Lightbulb

I have been able to find some useful information on using ado to connect to local exchange server and create an microsoft outlook task, but this will only work if run locally on exchange server.....


This design is not exhaustive, i.e. It do not expose a way to assign tasks
or set task recurrences, but if all you care about is
creating/modifying/deleting tasks plus setting duedate/status/completed
information on Task items in Private/Public Tasks folders, this should help
get you get some of the ways there.

Cut and Paste this definition.[VB]

'Core Task Properties
Const cdoTaskStartDate =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008104" 'PT_SYSTIME
Const cdoTaskDueDate =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008105" 'PT_SYSTIME
Const cdoTaskPercentComplete =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008102" 'PT_DOUBLE
Const cdoTaskComplete =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x0000811c" 'PT_BOOLEAN
Const cdoTaskDateCompleted =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x0000810f" 'PT_SYSTIME
Const cdoTaskStatus =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008101" 'PT_LONG
Const cdoTaskState =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008113" 'PT_LONG
Const cdoTaskActualEffort =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008110" 'PT_LONG
Const cdoTaskEstimatedEffort =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008111" 'PT_LONG
Const cdoTaskMode =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008518" 'PT_LONG

'Common Props
Const cdoBillingInformation =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008535" 'PT_UNICODE
Const cdoCompanies =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008539" 'PT_MV_UNICODE
Const cdoMileage =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008534" 'PT_UNICODE

'Reminder Props
Const cdoReminderDelta =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008501" 'PT_LONG
Const cdoReminderNextTime =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008560" 'PT_SYSTIME
Const cdoReminderTime =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008502" 'PT_SYSTIME
Const cdoReminderSet =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008502" 'PT_BOOLEAN


'Cut and Paste into VB, etc.
Private Sub Form_Load()
Dim TaskItem As New ADODB.Record

'Modify this URL to point to an item in your task folder
TaskItem.Open
"file://./backofficestorage/exappsdom.extest.microsoft.com/MBX/administrator
/tasks/mytask.eml", , adModeReadWrite, adCreateOverwrite
TaskItem.Fields.Item("DAV:contentclass") = "urn:content-classes:task"

TaskItem.Fields.Item("http://schemas.microsoft.com/exchange/outlookmessagecl
ass").Value = "IPM.Task"

'Set core Task props
TaskItem.Fields.Item(cdoTaskStartDate).Value = Now
TaskItem.Fields.Item(cdoTaskDueDate).Value = Now
TaskItem.Fields.Item(cdoTaskActualEffort).Value = 36000 'Minutes. This
prop is really funky.
TaskItem.Fields.Item(cdoTaskEstimatedEffort).Value = 72000 ''Minutes.
This prop is also funky.

'Set additional Props

TaskItem.Fields.Item("urn:schemas-microsoft-comfficeffice#Keywords").Val
ue = Array("Mango", "Kiwi")
TaskItem.Fields.Item("urn:schemas:httpmail:textdescription").Value =
"Ship the Product!!"
TaskItem.Fields.Item("urn:schemas:httpmail:subject").Value = "Tasks
Rock!!"
TaskItem.Fields.Item(cdoBillingInformation).Value = "Microsoft
Corporation"
TaskItem.Fields.Item(cdoCompanies).Value = Array("Cisco", "Microsoft")
TaskItem.Fields.Item(cdoMileage).Value = "120"
TaskItem.Fields.Append cdoTaskState, adInteger, , , 1
TaskItem.Fields.Update

'Set the PercentComplete and Task Status together for Unassigned Tasks
'TaskItem.Fields.Append cdoTaskPercentComplete, adDouble, , , "0.0"
'TaskItem.Fields.Append cdoTaskStatus, adInteger, , , 0
'TaskItem.Fields.Update
'MsgBox "The Task Status is Unassigned!"

'Set the PercentComplete and Task Status together when updating Task
Status
'TaskItem.Fields.Append cdoTaskPercentComplete, adDouble, , , "0.5"
'TaskItem.Fields.Append cdoTaskStatus, adInteger, , , 1
'TaskItem.Fields.Update
'MsgBox "The Task Status was Updated!"

'Set the PercentComplete, Task Status, Task Complete and
TaskDateCompleted together
'TaskItem.Fields.Append cdoTaskPercentComplete, adDouble, , , "1.0"
'TaskItem.Fields.Append cdoTaskStatus, adInteger, , , 2
'TaskItem.Fields.Item(cdoTaskComplete).Value = True
'TaskItem.Fields.Item(cdoTaskDateCompleted).Value = Now
'TaskItem.Fields.Update
'MsgBox "The Task Status was Updated!"

TaskItem.Close
End Sub

Reply With Quote
  #3  
Old April 11th, 2005, 03:22 AM
somitaa somitaa is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 1 somitaa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 43 sec
Reputation Power: 0
I want to know when a Task is assigned what properties should be set. Pls help


Quote:
Originally Posted by vp123
I have been able to find some useful information on using ado to connect to local exchange server and create an microsoft outlook task, but this will only work if run locally on exchange server.....


This design is not exhaustive, i.e. It do not expose a way to assign tasks
or set task recurrences, but if all you care about is
creating/modifying/deleting tasks plus setting duedate/status/completed
information on Task items in Private/Public Tasks folders, this should help
get you get some of the ways there.

Cut and Paste this definition.[VB]

'Core Task Properties
Const cdoTaskStartDate =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008104" 'PT_SYSTIME
Const cdoTaskDueDate =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008105" 'PT_SYSTIME
Const cdoTaskPercentComplete =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008102" 'PT_DOUBLE
Const cdoTaskComplete =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x0000811c" 'PT_BOOLEAN
Const cdoTaskDateCompleted =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x0000810f" 'PT_SYSTIME
Const cdoTaskStatus =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008101" 'PT_LONG
Const cdoTaskState =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008113" 'PT_LONG
Const cdoTaskActualEffort =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008110" 'PT_LONG
Const cdoTaskEstimatedEffort =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008111" 'PT_LONG
Const cdoTaskMode =
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}
/0x00008518" 'PT_LONG

'Common Props
Const cdoBillingInformation =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008535" 'PT_UNICODE
Const cdoCompanies =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008539" 'PT_MV_UNICODE
Const cdoMileage =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008534" 'PT_UNICODE

'Reminder Props
Const cdoReminderDelta =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008501" 'PT_LONG
Const cdoReminderNextTime =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008560" 'PT_SYSTIME
Const cdoReminderTime =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008502" 'PT_SYSTIME
Const cdoReminderSet =
"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}
/0x00008502" 'PT_BOOLEAN


'Cut and Paste into VB, etc.
Private Sub Form_Load()
Dim TaskItem As New ADODB.Record

'Modify this URL to point to an item in your task folder
TaskItem.Open
"file://./backofficestorage/exappsdom.extest.microsoft.com/MBX/administrator
/tasks/mytask.eml", , adModeReadWrite, adCreateOverwrite
TaskItem.Fields.Item("DAV:contentclass") = "urn:content-classes:task"

TaskItem.Fields.Item("http://schemas.microsoft.com/exchange/outlookmessagecl
ass").Value = "IPM.Task"

'Set core Task props
TaskItem.Fields.Item(cdoTaskStartDate).Value = Now
TaskItem.Fields.Item(cdoTaskDueDate).Value = Now
TaskItem.Fields.Item(cdoTaskActualEffort).Value = 36000 'Minutes. This
prop is really funky.
TaskItem.Fields.Item(cdoTaskEstimatedEffort).Value = 72000 ''Minutes.
This prop is also funky.

'Set additional Props

TaskItem.Fields.Item("urn:schemas-microsoft-comfficeffice#Keywords").Val
ue = Array("Mango", "Kiwi")
TaskItem.Fields.Item("urn:schemas:httpmail:textdescription").Value =
"Ship the Product!!"
TaskItem.Fields.Item("urn:schemas:httpmail:subject").Value = "Tasks
Rock!!"
TaskItem.Fields.Item(cdoBillingInformation).Value = "Microsoft
Corporation"
TaskItem.Fields.Item(cdoCompanies).Value = Array("Cisco", "Microsoft")
TaskItem.Fields.Item(cdoMileage).Value = "120"
TaskItem.Fields.Append cdoTaskState, adInteger, , , 1
TaskItem.Fields.Update

'Set the PercentComplete and Task Status together for Unassigned Tasks
'TaskItem.Fields.Append cdoTaskPercentComplete, adDouble, , , "0.0"
'TaskItem.Fields.Append cdoTaskStatus, adInteger, , , 0
'TaskItem.Fields.Update
'MsgBox "The Task Status is Unassigned!"

'Set the PercentComplete and Task Status together when updating Task
Status
'TaskItem.Fields.Append cdoTaskPercentComplete, adDouble, , , "0.5"
'TaskItem.Fields.Append cdoTaskStatus, adInteger, , , 1
'TaskItem.Fields.Update
'MsgBox "The Task Status was Updated!"

'Set the PercentComplete, Task Status, Task Complete and
TaskDateCompleted together
'TaskItem.Fields.Append cdoTaskPercentComplete, adDouble, , , "1.0"
'TaskItem.Fields.Append cdoTaskStatus, adInteger, , , 2
'TaskItem.Fields.Item(cdoTaskComplete).Value = True
'TaskItem.Fields.Item(cdoTaskDateCompleted).Value = Now
'TaskItem.Fields.Update
'MsgBox "The Task Status was Updated!"

TaskItem.Close
End Sub

Reply With Quote
  #4  
Old March 7th, 2007, 04:37 AM
bleuerouge bleuerouge is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 1 bleuerouge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 15 sec
Reputation Power: 0
outlook Task

Hello, I wrote this code from your this preceding code and it seems to be not functionnal.
In fact, it write in right folder but the message format seems to be wrong (message appear like simple mailmessage and not like outlook Task).

please can you help me ?

thanks a lot

Code:
public string AddTache (string destinataire,string dtstart, string dtend, string dtdue, string sujetTache, string descriptionTache)
		{
			string result = String.Empty;

			 // Core Task Properties
			string cdoTaskStartDate = "{00062003-0000-0000-C000-000000000046}/0x00008104" ;
			string cdoTaskDueDate = "{00062003-0000-0000-C000-000000000046}/0x00008105";
			string cdoTaskPercentComplete = "{00062003-0000-0000-C000-000000000046}/0x00008102";
			string cdoTaskComplete = "{00062003-0000-0000-C000-000000000046}/0x0000811c";
			string cdoTaskDateCompleted = "{00062003-0000-0000-C000-000000000046}/0x0000810f";
			string cdoTaskStatus = "{00062003-0000-0000-C000-000000000046}/0x00008101";
			string cdoTaskState = "{00062003-0000-0000-C000-000000000046}/0x00008113";
			string cdoTaskActualEffort = "{00062003-0000-0000-C000-000000000046}/0x00008110";
			string cdoTaskEstimatedEffort = "{00062003-0000-0000-C000-000000000046}/0x00008111";
			string cdoTaskMode = "{00062003-0000-0000-C000-000000000046}/0x00008518";

			//Common Props
			string cdoBillingInformation = "{00062008-0000-0000-C000-000000000046}/0x00008535";
			string cdoCompanies ="{00062008-0000-0000-C000-000000000046}/0x00008539";
			string cdoMileage = "{00062008-0000-0000-C000-000000000046}/0x00008534";

			// Reminder Props
			string cdoReminderDelta = "{00062008-0000-0000-C000-000000000046}/0x00008501";
			string cdoReminderNextTime = "{00062008-0000-0000-C000-000000000046}/0x00008560";
			string cdoReminderTime = "{00062008-0000-0000-C000-000000000046}/0x00008502";
			string cdoReminderSet = "{00062008-0000-0000-C000-000000000046}/0x00008502";

			string sURL = string.Empty;

			try 
			{
 				sURL = ConfigurationSettings.AppSettings["serveur"] + destinataire + "/t%C3%A2ches/" + Guid.NewGuid().ToString() + sujetTache +".eml";		

				ADODB.Connection oCn = new ADODB.Connection();
				ADODB.Record oRc = new ADODB.Record();
				ADODB.Fields oFields;

				oCn.Provider = "exoledb.datasource";

				oCn.Open(sURL, "", "", 0);  
				if(oCn.State == 1)
				{
					result = result + "Connection Successful";
				}
				else
				{
					result = result + "Connection Unsuccessful";
					return result;
				}			
			
				oRc.Open(sURL, oCn, 
					ADODB.ConnectModeEnum.adModeReadWrite, 
					ADODB.RecordCreateOptionsEnum.adCreateOverwrite,
					ADODB.RecordOpenOptionsEnum.adOpenSource,
					"",
					""
					);
			
				oFields = oRc.Fields;

				oFields["DAV:contentclass"].Value = "urn:content-classes:task";
				oFields["(URL address blocked: See forum rules)"].Value = "IPM.Task";

				oFields["urn:schemas:httpmail:subject"].Value = sujetTache;
				oFields["urn:schemas:httpmail:htmldescription"].Value = "MACH 4 CRM : " + descriptionTache + "<br/><a href='" + ConfigurationSettings.AppSettings["MACH4CRM_path"] + "'>"+ sURL + "</a><br/>Outlook Web Access :<a href='"+sURL+"?cmd=open' >" + sujetTache + "</a>";
				oFields["urn:schemas:httpmail:textdescription"].Value = descriptionTache;
				oFields[cdoTaskStartDate].Value = DateTime.Parse(dtstart);
				oFields[cdoTaskDueDate].Value = DateTime.Parse(dtdue);
				oFields[cdoTaskActualEffort].Value = 36000; // Minutes. This prop is really funky.
				oFields[cdoTaskEstimatedEffort].Value = 72000; // Minutes This prop is also funky.
				
				oFields[cdoReminderSet].Value = true;
				oFields[cdoReminderDelta].Value = 1500; // 15 minutes.
				oFields[cdoReminderNextTime].Value = DateTime.Parse(dtend);
				
				//oFields.Update();

				//oFields["urn:schemas-microsoft-comfficeffice#Keywords"].Value = Array("Mango", "Kiwi");

				oFields[cdoBillingInformation].Value = "MACH4";
				//oFields[cdoCompanies].Value = {"MACH4"};
				//oFields[cdoMileage].Value = "120";
				
				//oFields.Append(cdoTaskStatus,ADODB.DataTypeEnum.ad  Integer,0 ,0 , 0);
				//oFields.Append(cdoTaskPercentComplete, ADODB.DataTypeEnum.adDouble,0 ,0 , "0.0");

				oFields.Update();			
				oRc.Close();
				oRc = null;
				oFields = null;
				oCn.Close();
				oCn = null;
				
			}
			catch (Exception e)
			{
				return sURL + e.Message.ToString() + "<br/>" + e.Source.ToString() + e.HelpLink +e.InnerException;
			}
			return result;
		}

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Creating Tasks in Exchange Server 2003


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap