Tasks
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
Tasks

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
Alex
Guest





Posted: Thu Sep 29, 2005 12:58 am    Post subject: Tasks Reply with quote

Hello,

I am trying to create a new Task from a C# program.
I want to create the new task, let the user enter values in a stadard
Outlook Form, and then process the informatioin.
If the form is shown as non-Modal, then I don't have access to the user
information, which makes sense.
So I display the form in a Modal mode, and then I have access to the info
once the users saves the task. However,
the form stays open. (It blinks once, so it looks like there is another copy
of it behind it, which there isn't.)
Any idea how to display a Modal task form and not have it stay up?

Here is the code:
{
Outlook.ApplicationClass oApp = new Outlook.ApplicationClass();
Outlook.NameSpace oNS = oApp.GetNamespace( "MAPI" );
Outlook.TaskItemClass oTask = (Outlook.TaskItemClass)oApp.CreateItem(
Outlook.OlItemType.olTaskItem );
oTask.Display( true );

// oTask.Subject = "Task1";
// oTask.StartDate = DateTime.Now;
// oTask.DueDate = DateTime.Now.AddDays(7);
// oTask.Save();

MessageBox.Show( oTask.Subject );

// I tried to close the form manually, but that doesn't seem to have any
affect.
oTask.Close( Outlook.OlInspectorClose.olDiscard );

oTask = null;
oApp = null;
GC.WaitForPendingFinalizers();
GC.Collect();
}

I've also tried using the Outlook._TaskItem interface, and get the same
result.

TIA
Alex

Back to top
Henning Krause [MVP - Exc
Guest





Posted: Thu Sep 29, 2005 4:58 pm    Post subject: Re: Tasks Reply with quote

Hello,

it should be possible to open the form modeless. But before calling
oTask.Display(), attach an event handler to the oTask.Close event and
process the results when that event is called.

Greetings,
Henning Krause
MVP - Exchange
http://www.infinitec.de


"Alex" <Alex.Avid@newsgroups.nospam> wrote in message
news:ubF5XgHxFHA.3400@TK2MSFTNGP14.phx.gbl...
Quote:
Hello,

I am trying to create a new Task from a C# program.
I want to create the new task, let the user enter values in a stadard
Outlook Form, and then process the informatioin.
If the form is shown as non-Modal, then I don't have access to the user
information, which makes sense.
So I display the form in a Modal mode, and then I have access to the info
once the users saves the task. However,
the form stays open. (It blinks once, so it looks like there is another
copy of it behind it, which there isn't.)
Any idea how to display a Modal task form and not have it stay up?

Here is the code:
{
Outlook.ApplicationClass oApp = new Outlook.ApplicationClass();
Outlook.NameSpace oNS = oApp.GetNamespace( "MAPI" );
Outlook.TaskItemClass oTask = (Outlook.TaskItemClass)oApp.CreateItem(
Outlook.OlItemType.olTaskItem );
oTask.Display( true );

// oTask.Subject = "Task1";
// oTask.StartDate = DateTime.Now;
// oTask.DueDate = DateTime.Now.AddDays(7);
// oTask.Save();

MessageBox.Show( oTask.Subject );

// I tried to close the form manually, but that doesn't seem to have any
affect.
oTask.Close( Outlook.OlInspectorClose.olDiscard );

oTask = null;
oApp = null;
GC.WaitForPendingFinalizers();
GC.Collect();
}

I've also tried using the Outlook._TaskItem interface, and get the same
result.

TIA
Alex
Back to top
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server Dedicated Servers
Contact Us
New Topics Powered by phpBB