PC Review


Reply
Thread Tools Rate Thread

Custom Form ERROR

 
 
=?Utf-8?B?YmFjazJncmlk?=
Guest
Posts: n/a
 
      8th Jun 2005
Hi,
I have what seems to be a strange problem. Firstly i created a add-in in
vs.net that adds new tasks for a user from a project management app. In order
to view custom data from the external app i've created a custom form. This
form contains basically a ActiveX control (written in .NET C#). When the
item(s) are
added, the message class is set to this custom form. The problem i'm seeing
is
that immediately after my add-in loads the tasks, and i click open a task,
the default form shows up instead of custom form. Now If i close my outlook
app (not just the item) and start it up again and then open the same task
item, i get the task in my custom form.
To work around i create a outlook template file of my custom form. i then
add items by using the createitemfromtemplate function. After adding the
ActiveAllowOneOffForms with DWORD set to 1. i get everything working smoothly.

Why is outlook not loading the custom form for the first time. i would like
to avoid the registry entry.

Anybody seen this issue before.

thanks

 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      8th Jun 2005
Maybe you could show a code snippet to illustrate how you're creating the tasks. If you want them to use a custom form, you should be using a published form and creating the items with Add method on the target folder's Items collection.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"back2grid" <(E-Mail Removed)> wrote in message news:9DBEB1BD-5251-41D8-B6B0-(E-Mail Removed)...
> Hi,
> I have what seems to be a strange problem. Firstly i created a add-in in
> vs.net that adds new tasks for a user from a project management app. In order
> to view custom data from the external app i've created a custom form. This
> form contains basically a ActiveX control (written in .NET C#). When the
> item(s) are
> added, the message class is set to this custom form. The problem i'm seeing
> is
> that immediately after my add-in loads the tasks, and i click open a task,
> the default form shows up instead of custom form. Now If i close my outlook
> app (not just the item) and start it up again and then open the same task
> item, i get the task in my custom form.
> To work around i create a outlook template file of my custom form. i then
> add items by using the createitemfromtemplate function. After adding the
> ActiveAllowOneOffForms with DWORD set to 1. i get everything working smoothly.
>
> Why is outlook not loading the custom form for the first time. i would like
> to avoid the registry entry.
>
> Anybody seen this issue before.
>
> thanks
>

 
Reply With Quote
 
=?Utf-8?B?YmFjazJncmlk?=
Guest
Posts: n/a
 
      9th Jun 2005
Sue,
thanks for the reply. Here it goes..
Outlook.Application app = new Application();
TaskItem item = null;
item = (TaskItem)app.CreateItem(OlItemType.olTaskItem);
item.subject = ...
item.MessageClass = "IPM.Task.MyCustomForm";
item.Save();

this code adds the item correctly but when i open the task for view my
custom form it just opens the default form. If i close and open outlook
applicaiton, the tasks now open in the intended "MyCustomForm".

Right now i've saved the form as a Outlook template and use the following
code.
Outlook.ApplicationClass appClass = new ApplicaitonClass():
Outlook.NameSpace ns = appClass.GetNameSpace("MAPI);
Outlook.MAPIFolder oTaskItems =
ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderTasks);

item =
(TaskItem)app.CreateItemFromTemplate("C:\myformTemplate.oft",oTaskItems);
item.subject = ...
item.MessageClass = "IPM.Task.MyCustomForm";
item.Save();

Using this code and adding the AllowActivexOneOffForms registry entry seems
to be working correctly. But i wanted to have the code piece #1 to be working
correctly. The forms are obviously published.

hope this helps

thanks

"Sue Mosher [MVP-Outlook]" wrote:

> Maybe you could show a code snippet to illustrate how you're creating the tasks. If you want them to use a custom form, you should be using a published form and creating the items with Add method on the target folder's Items collection.
>
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "back2grid" <(E-Mail Removed)> wrote in message news:9DBEB1BD-5251-41D8-B6B0-(E-Mail Removed)...
> > Hi,
> > I have what seems to be a strange problem. Firstly i created a add-in in
> > vs.net that adds new tasks for a user from a project management app. In order
> > to view custom data from the external app i've created a custom form. This
> > form contains basically a ActiveX control (written in .NET C#). When the
> > item(s) are
> > added, the message class is set to this custom form. The problem i'm seeing
> > is
> > that immediately after my add-in loads the tasks, and i click open a task,
> > the default form shows up instead of custom form. Now If i close my outlook
> > app (not just the item) and start it up again and then open the same task
> > item, i get the task in my custom form.
> > To work around i create a outlook template file of my custom form. i then
> > add items by using the createitemfromtemplate function. After adding the
> > ActiveAllowOneOffForms with DWORD set to 1. i get everything working smoothly.
> >
> > Why is outlook not loading the custom form for the first time. i would like
> > to avoid the registry entry.
> >
> > Anybody seen this issue before.
> >
> > thanks
> >

>

 
Reply With Quote
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      9th Jun 2005
As I said, to create a new instance of a custom form programmatically, you need to use the Add method on the target folder's Items collection. Pass the message class of the form as the argument:
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"back2grid" <(E-Mail Removed)> wrote in message news:3E9B9BE8-F7AD-4135-8862-(E-Mail Removed)...
> Sue,
> thanks for the reply. Here it goes..
> Outlook.Application app = new Application();
> TaskItem item = null;
> item = (TaskItem)app.CreateItem(OlItemType.olTaskItem);
> item.subject = ...
> item.MessageClass = "IPM.Task.MyCustomForm";
> item.Save();
>
> this code adds the item correctly but when i open the task for view my
> custom form it just opens the default form. If i close and open outlook
> applicaiton, the tasks now open in the intended "MyCustomForm".
>>

 
Reply With Quote
 
=?Utf-8?B?YmFjazJncmlk?=
Guest
Posts: n/a
 
      10th Jun 2005
It worked!!!
thanks sue. My other post regarding Userproperties being lost. that problem
seems also resolved. i will further test and let me know. One other strange
thing i observe is that sometimes, when i close outlook and try to open
immediately it says "The Operation failed". After may be 3-4 seconds, outlook
opens nicely and works fine. I thinks outlook takes time to unload the
activex controls i guess.
Any idea?

thanks again Sue

"Sue Mosher [MVP-Outlook]" wrote:

> As I said, to create a new instance of a custom form programmatically, you need to use the Add method on the target folder's Items collection. Pass the message class of the form as the argument:
> --
> Sue Mosher, Outlook MVP
> Author of
> Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
> "back2grid" <(E-Mail Removed)> wrote in message news:3E9B9BE8-F7AD-4135-8862-(E-Mail Removed)...
> > Sue,
> > thanks for the reply. Here it goes..
> > Outlook.Application app = new Application();
> > TaskItem item = null;
> > item = (TaskItem)app.CreateItem(OlItemType.olTaskItem);
> > item.subject = ...
> > item.MessageClass = "IPM.Task.MyCustomForm";
> > item.Save();
> >
> > this code adds the item correctly but when i open the task for view my
> > custom form it just opens the default form. If i close and open outlook
> > applicaiton, the tasks now open in the intended "MyCustomForm".
> >>

>

 
Reply With Quote
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      10th Jun 2005
Outlook has to unload all its mail account services, close PST files, etc. Wait a little longer.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"back2grid" <(E-Mail Removed)> wrote in message news:064D8C68-097E-4056-93A4-(E-Mail Removed)...
> It worked!!!
> thanks sue. My other post regarding Userproperties being lost. that problem
> seems also resolved. i will further test and let me know. One other strange
> thing i observe is that sometimes, when i close outlook and try to open
> immediately it says "The Operation failed". After may be 3-4 seconds, outlook
> opens nicely and works fine. I thinks outlook takes time to unload the
> activex controls i guess.
> Any idea?
>
> thanks again Sue
>
> "Sue Mosher [MVP-Outlook]" wrote:
>
>> As I said, to create a new instance of a custom form programmatically, you need to use the Add method on the target folder's Items collection. Pass the message class of the form as the argument:


>>
>> "back2grid" <(E-Mail Removed)> wrote in message news:3E9B9BE8-F7AD-4135-8862-(E-Mail Removed)...
>> > Sue,
>> > thanks for the reply. Here it goes..
>> > Outlook.Application app = new Application();
>> > TaskItem item = null;
>> > item = (TaskItem)app.CreateItem(OlItemType.olTaskItem);
>> > item.subject = ...
>> > item.MessageClass = "IPM.Task.MyCustomForm";
>> > item.Save();
>> >
>> > this code adds the item correctly but when i open the task for view my
>> > custom form it just opens the default form. If i close and open outlook
>> > applicaiton, the tasks now open in the intended "MyCustomForm".
>> >>

>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How fix: Error Msg.: Outl. can't use custom form, using Out. Form =?Utf-8?B?VC4gTXVycGhleQ==?= Microsoft Outlook Discussion 0 12th May 2006 04:57 PM
Custom error form in asp.net web app =?Utf-8?B?TGFycnk=?= Microsoft ASP .NET 2 7th Apr 2005 03:23 PM
Error on Custom Form Message =?Utf-8?B?UGhlbml4?= Microsoft Outlook Form Programming 14 3rd Feb 2005 05:33 PM
OL looking for a custom form - error Douglas Buchanan Microsoft Outlook Discussion 0 30th Dec 2003 03:44 AM
Mini Problem: A custom mail-form create a custom task-form Christoph Sbach Microsoft Outlook Form Programming 4 5th Nov 2003 05:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:11 PM.