A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

outlook newmail event for different version causing problems



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 9th 07, 04:47 AM posted to microsoft.public.outlook.program_addins
kedar_vj via OfficeKB.com
external usenet poster
 
Posts: 2
Default outlook newmail event for different version causing problems

I have handled new mail events for OL XP. but while installing in OL2003 its
giving error
"could not load type outlook.applicationevents_11_ newemaileventHandler from
asembly interop.outlook " OBVIOUSLY its version difference
but is there any way out to handle/get such event which can handle new mail
event in all outlook versions?
Any workarounds to capture all versions newemaileventhandler !!!??
please reply, is it possible to do that?

I have tried with addin
outlook 2003(11 object lib (v. 9.2)) works in OL2003 only
outlook 2002(10 object lib (v. 9.1)) works in OL2002(XP) only
and again OL2000 is having annoying different "FEATURES" to work with.
I don't understand how to do that thing work !!

I have seen OutlookSpy "an addin" works with any outlook !! So
there must not be different code for each outlook !
(though not at my scenario of new mail but still it works)
Then my add-in should work too.

the error i am getting is:
"system.runtime.interopservices.comexception(0x800 40200.........
at outlook.applicationevents_11_EventProvider.init(). ..
.................................."


this occurs when i try to get the applicationObject in to a variable.
outapp = ApplicationObject

outapp object is responsible to handle the new-email-events and hence
i must have to declare it
WITHEVENTS outapp as outlook.application

this is where problem lies !!
outlook.application is Ref. to OL2003
applicationObject is of OL-2002(XP)
so is there any way out to get out of this !!

--
Message posted via http://www.officekb.com

Ads
  #2  
Old January 9th 07, 02:38 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default outlook newmail event for different version causing problems

OutlookSpy works directly with Extended MAPI, it has nothing to do with
PIA's or .NET. In COM coding you don't have those 10, 11 or 12 events. You
just have events that are or aren't present in a specific version of
Outlook.

Extended MAPI can only be used generally from C++ or Delphi and is not
supported at all for .NET use.

The Outlook 2003 PIA's are not installed by default, you must explicitly
install them or have your application install them.

In general, if you are targeting multiple versions of Outlook you use only
those events present in the earliest version you intend to support. Using
ApplicationEvents_11_NewMailEventHandler would only work for Outlook 2003.
Using ApplicationEvents_10_NewMailEventHandler would only work for Outlook
2002.

For use in those situations you can fall back to the usage that would work
in Outlook 2000, 2002 and 2003 (and 2007), since NewMail exists in Outlook
2000 and later. Use ApplicationEvents_NewMailEventHandler.

Learn to make use of the Object Browser, which shows all methods and
properties and events that are available to you.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"kedar_vj via OfficeKB.com" u30776@uwe wrote in message
news:6c0237dd76f37@uwe...
I have handled new mail events for OL XP. but while installing in OL2003
its
giving error
"could not load type outlook.applicationevents_11_ newemaileventHandler
from
asembly interop.outlook " OBVIOUSLY its version difference
but is there any way out to handle/get such event which can handle new
mail
event in all outlook versions?
Any workarounds to capture all versions newemaileventhandler !!!??
please reply, is it possible to do that?

I have tried with addin
outlook 2003(11 object lib (v. 9.2)) works in OL2003 only
outlook 2002(10 object lib (v. 9.1)) works in OL2002(XP) only
and again OL2000 is having annoying different "FEATURES" to work with.
I don't understand how to do that thing work !!

I have seen OutlookSpy "an addin" works with any outlook !! So
there must not be different code for each outlook !
(though not at my scenario of new mail but still it works)
Then my add-in should work too.

the error i am getting is:
"system.runtime.interopservices.comexception(0x800 40200.........
at outlook.applicationevents_11_EventProvider.init(). ..
................................."


this occurs when i try to get the applicationObject in to a variable.
outapp = ApplicationObject

outapp object is responsible to handle the new-email-events and hence
i must have to declare it
WITHEVENTS outapp as outlook.application

this is where problem lies !!
outlook.application is Ref. to OL2003
applicationObject is of OL-2002(XP)
so is there any way out to get out of this !!

--
Message posted via http://www.officekb.com


  #3  
Old January 16th 07, 05:17 AM posted to microsoft.public.outlook.program_addins
kedar_vj via OfficeKB.com
external usenet poster
 
Posts: 2
Default outlook newmail event for different version causing problems

thank you ken for reply.
but there is a problem with this NewMailEventhandler only.
I'm NOT using ApplicationEvents_10_NewMailEventHandler to handle new mail
event.
i am using application event's NewMailEventHandler.
but this too generates the error.

Private Sub outApp_NewMail() Handles outApp.NewMail
[where outapp is outlook object of perticular outlook PIA. OL 2k,2k3...
]
as internally this must be using the "_11_Newmailevent"
and hence this has been a big problem for me to code !


Ken Slovak - [MVP - Outlook] wrote:
OutlookSpy works directly with Extended MAPI, it has nothing to do with
PIA's or .NET. In COM coding you don't have those 10, 11 or 12 events. You
just have events that are or aren't present in a specific version of
Outlook.

Extended MAPI can only be used generally from C++ or Delphi and is not
supported at all for .NET use.

The Outlook 2003 PIA's are not installed by default, you must explicitly
install them or have your application install them.

In general, if you are targeting multiple versions of Outlook you use only
those events present in the earliest version you intend to support. Using
ApplicationEvents_11_NewMailEventHandler would only work for Outlook 2003.
Using ApplicationEvents_10_NewMailEventHandler would only work for Outlook
2002.

For use in those situations you can fall back to the usage that would work
in Outlook 2000, 2002 and 2003 (and 2007), since NewMail exists in Outlook
2000 and later. Use ApplicationEvents_NewMailEventHandler.

Learn to make use of the Object Browser, which shows all methods and
properties and events that are available to you.

I have handled new mail events for OL XP. but while installing in OL2003
its

[quoted text clipped - 35 lines]
applicationObject is of OL-2002(XP)
so is there any way out to get out of this !!


--
Message posted via http://www.officekb.com

  #4  
Old January 16th 07, 04:05 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default outlook newmail event for different version causing problems

Normally you develop on a machine with the lowest version of Outlook
installed that you intend to support, then you just reference the PIA for
that version of Outlook. Outlook 2000 is a special case because it doesn't
have a PIA and you must specially modify the Outlook 2002 PIA.

You can also install multiple versions of a PIA, for example the Outlook 10
and 11 PIA's, on one development machine. In your case you should have both
PIA's installed and set your Outlook reference to the Outlook 10 PIA.

A more .NET approach is really to develop separate applications for each
version of an application that you intend to support. Using that approach
you would have separate applications for Outlook 10 and Outlook 11.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"kedar_vj via OfficeKB.com" u30776@uwe wrote in message
news:6c5a7df78eac8@uwe...
thank you ken for reply.
but there is a problem with this NewMailEventhandler only.
I'm NOT using ApplicationEvents_10_NewMailEventHandler to handle new
mail
event.
i am using application event's NewMailEventHandler.
but this too generates the error.

Private Sub outApp_NewMail() Handles outApp.NewMail
[where outapp is outlook object of perticular outlook PIA. OL
2k,2k3...
]
as internally this must be using the "_11_Newmailevent"
and hence this has been a big problem for me to code !


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
1. Back Like That [(Remix) Album Version (...4:10Back Like That [(Remix...2. Run [Album Version (Explicit)] [Explici...3:19The Pretty Toney Album...3. Tush [Album Version (Explicit)] [Explic...3:24The Pretty Toney Album...4. One [Album Version]3:45Su omar gubran Outlook Express 1 December 19th 06 03:08 AM
How to fire NewMail&NewMailEx Event? baryon Outlook - General Queries 0 August 17th 06 04:31 PM
Message Rules Causing Problems Blobbies Outlook Express 1 February 9th 06 02:48 PM
Web version only shows 1 event per day at calendar? akm Outlook - Calandaring 2 January 29th 06 03:05 PM
Should I deleat trail version and install real version ? Trail Outlook Outlook - Installation 0 January 27th 06 02:47 PM


All times are GMT +1. The time now is 01:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.