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 » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Simple MAPI send and Outlook COM addin



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 1st 09, 03:31 PM posted to microsoft.public.outlook.program_vba
Mark Smith[_2_]
external usenet poster
 
Posts: 3
Default Simple MAPI send and Outlook COM addin

I've got a COM addin that adds a toolbar to Outlook inspectors.

In another process I call the Simple MAPI MAPISendMail function. When the
new e-mail dialog pops up, my addin toolbar does not appear. I figured out
that the same behavior happens if I open up a new send e-mail dialog via the
send to mail shell context menu.

I heard a long time ago that in some cases Outlook opens in a mode where no
addins are loaded. However, even if Outlook is already running (in which
case my addin is already loaded), my addin toolbar does not appear. I ran
through it with a debugger, and none of my code is hit for this particular
inspector.

What if I use Extended MAPI to do this? Since it happens for both Simple
MAPI and the shell send to mail context menu, I'm assuming that it won't work
for Extended MAPI either. Is there something else I can do about this or is
it just a limitation of Outlook?

Thanks
Mark Smith
Ads
  #2  
Old June 1st 09, 08:36 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Simple MAPI send and Outlook COM addin

When a Simple MAPI message is opened by Outlook any addins will run if
Outlook is running already, and if the addin is correctly written it will
run even if Outlook wasn't previously running. It all depends on how the
addin is written and what it does when OnConnection is fired.

A new Inspector opened from a Simple MAPI message is added to the Inspectors
collection, but it doesn't fire the Inspectors.NewInspector() event. Since
that's how most code will discover an Inspector was opened the code won't
know about the new Inspector, unless you scan the Inspectors collection and
account for any open Inspectors that aren't already being handled.

Using Extended MAPI won't help with this, the limitations would be the same.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Mark Smith" wrote in message
...
I've got a COM addin that adds a toolbar to Outlook inspectors.

In another process I call the Simple MAPI MAPISendMail function. When the
new e-mail dialog pops up, my addin toolbar does not appear. I figured
out
that the same behavior happens if I open up a new send e-mail dialog via
the
send to mail shell context menu.

I heard a long time ago that in some cases Outlook opens in a mode where
no
addins are loaded. However, even if Outlook is already running (in which
case my addin is already loaded), my addin toolbar does not appear. I ran
through it with a debugger, and none of my code is hit for this particular
inspector.

What if I use Extended MAPI to do this? Since it happens for both Simple
MAPI and the shell send to mail context menu, I'm assuming that it won't
work
for Extended MAPI either. Is there something else I can do about this or
is
it just a limitation of Outlook?

Thanks
Mark Smith


  #3  
Old June 16th 09, 03:58 PM posted to microsoft.public.outlook.program_vba
Mark Smith[_2_]
external usenet poster
 
Posts: 3
Default Simple MAPI send and Outlook COM addin

Thanks for the reply Ken.

I finally got back to this issue, and I've got a few more questions.

As far as finding the new inspector without the NewInspector event firing,
are you suggesting doing something like a timer based polling? Or is there
some other event to trap? I didn't see anything that looked like it would
work. Maybe I'm looking in the wrong place...

You also say that for the case where Outlook isn't already running the addin
should load. I rechecked my code and the addin does get loaded. However I
tried checking the inspector collection in the OnStartupComplete event, which
is the last one that I get other than the ones for the inspectors or toolbars
themselves. The inspector collection is still empty at this point. So
again, is there some other later event to trap, or am I stuck with a polling
solution here also?

Thanks,
Mark Smith

"Ken Slovak - [MVP - Outlook]" wrote:

When a Simple MAPI message is opened by Outlook any addins will run if
Outlook is running already, and if the addin is correctly written it will
run even if Outlook wasn't previously running. It all depends on how the
addin is written and what it does when OnConnection is fired.

A new Inspector opened from a Simple MAPI message is added to the Inspectors
collection, but it doesn't fire the Inspectors.NewInspector() event. Since
that's how most code will discover an Inspector was opened the code won't
know about the new Inspector, unless you scan the Inspectors collection and
account for any open Inspectors that aren't already being handled.

Using Extended MAPI won't help with this, the limitations would be the same.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Mark Smith" wrote in message
...
I've got a COM addin that adds a toolbar to Outlook inspectors.

In another process I call the Simple MAPI MAPISendMail function. When the
new e-mail dialog pops up, my addin toolbar does not appear. I figured
out
that the same behavior happens if I open up a new send e-mail dialog via
the
send to mail shell context menu.

I heard a long time ago that in some cases Outlook opens in a mode where
no
addins are loaded. However, even if Outlook is already running (in which
case my addin is already loaded), my addin toolbar does not appear. I ran
through it with a debugger, and none of my code is hit for this particular
inspector.

What if I use Extended MAPI to do this? Since it happens for both Simple
MAPI and the shell send to mail context menu, I'm assuming that it won't
work
for Extended MAPI either. Is there something else I can do about this or
is
it just a limitation of Outlook?

Thanks
Mark Smith



  #4  
Old June 16th 09, 04:29 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Simple MAPI send and Outlook COM addin

Polling is the answer to both questions.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Mark Smith" wrote in message
...
Thanks for the reply Ken.

I finally got back to this issue, and I've got a few more questions.

As far as finding the new inspector without the NewInspector event firing,
are you suggesting doing something like a timer based polling? Or is
there
some other event to trap? I didn't see anything that looked like it would
work. Maybe I'm looking in the wrong place...

You also say that for the case where Outlook isn't already running the
addin
should load. I rechecked my code and the addin does get loaded. However
I
tried checking the inspector collection in the OnStartupComplete event,
which
is the last one that I get other than the ones for the inspectors or
toolbars
themselves. The inspector collection is still empty at this point. So
again, is there some other later event to trap, or am I stuck with a
polling
solution here also?

Thanks,
Mark Smith


 




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
Faxing problem via Simple Mapi in Server2003/Exchange environment Jimmy Hoffa Outlook - Fax Functions 2 October 30th 08 10:15 PM
Is there a simple way to send my contact listing to another user? looking for a shortcut Outlook - Using Contacts 2 October 15th 08 04:10 AM
Outlook COM Addin and MAPI Provider Windoze Add-ins for Outlook 1 January 14th 08 06:45 PM
Outlook security block & Simple Mapi Jacob Havkrog Outlook and VBA 2 March 14th 07 05:58 PM
Out Look Express & Simple MAPI , Outlook ExMAPI example Robert Palmer Add-ins for Outlook 1 April 18th 06 03:35 PM


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


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