Simple MAPI send and Outlook COM addin

Status
Not open for further replies.
T

TWFyayBTbWl0aA

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
 
K

Ken Slovak - [MVP - Outlook]

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.

"Mark Smith" <MarkSmith> wrote in message

news:9F3BFD98-808A-46B8-89E7-B5EFC5D92D8E@microsoft.com...
> 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
 
M

Mark Smith

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
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.

> >

>

> "Mark Smith" <MarkSmith> wrote in message
> news:9F3BFD98-808A-46B8-89E7-B5EFC5D92D8E@microsoft.com...
> > 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


>
 
K

Ken Slovak - [MVP - Outlook]

Polling is the answer to both questions.

"Mark Smith" <MarkSmith> wrote in message

news:53BDC2A8-A78C-4B3D-B9A6-681A43B49B6A@microsoft.com...
> 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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
GregS Simple calendar sharing doesn't work Using Outlook 6
F Simple code to look for a specific line Outlook VBA and Custom Forms 2
K Ask about a simple script about save a incoming mail as file on local PC Outlook VBA and Custom Forms 3
P Simple contact and project manger like MissingLink for Outlook Using Outlook 1
L Simple Macro Using Outlook 1
B Is there a simple way to share email folders w/o exchange server? Using Outlook 0
C Need Help with Simple Code Correction Using Outlook 11
F I want simple syncing between my 3 PCs and Android devices. Using Outlook 1
H Too simple I would think but.. Using Outlook 1
D Help with simple macro - looping though all emails in my inbox Using Outlook 3
T Location and simple copying of emails and settings, OL 2010 and Win 7 64bit. Using Outlook 3
R Simple Sharing of Outlook Profile Using Outlook 1
Rupert Dragwater Is there a genuine simple way to move Eudora address to Outlook 2010 Using Outlook 2
R BCM with MS Office Accounting... Simple question BCM (Business Contact Manager) 0
P Simple Marketing Campaign Question BCM (Business Contact Manager) 1
B Simple way to insert file text - macro? Outlook VBA and Custom Forms 1
V simple move to personal folder Outlook VBA and Custom Forms 1
pcunite Outlook 2019/O365 Build 13127.20408 errors when using MAPI calls Using Outlook 1
F MAPI, User Defined Fields and perspective after 20 years Outlook VBA and Custom Forms 0
Dennis Gaudenzi Your setup couldn't be started because of an unexpected error (mapi 0x80040604) Using Outlook 14
A How to enable outlook room finder (outlook connector (mapi)) user ? Using Outlook 3
J Unwanted US Holiday Contact folder in Outlook.com syncs to MAPI/Phone Address book Using Outlook.com accounts in Outlook 9
P office 2013 communigate mapi Using Outlook 0
S Outlook 2013 MAPI 1.0 Error Using Outlook 2
L Mapi folder.FIND: error Using Outlook 0
J [outlook-users] Icloud + Mapi profile + Using Outlook 1
C MAPI to access a 64 bit Outlook from a 32 bit application; or access via ODBC Using Outlook 0
K Two MAPI Accounts One Contacts data set Using Outlook.com accounts in Outlook 2
E Redemption MAPI access(c#) Outlook VBA and Custom Forms 4
E Google MAPI account Outlook VBA and Custom Forms 4
P CDO MAPI Session failing to retrieve user name but Getexchage user Outlook VBA and Custom Forms 2
R Create a new contact use MAPI? Outlook VBA and Custom Forms 2
A Generating valid MAPI URLs for Outlook 2003 Outlook VBA and Custom Forms 2
M Custom mapi is not displayed in the readingpane. Why? Outlook VBA and Custom Forms 1
M How to install custom mapi form programmatically? Outlook VBA and Custom Forms 1
M How to add a message to a mapi view folder Outlook VBA and Custom Forms 1
T Setting a MAPI property of type PT_SYSTIME Outlook VBA and Custom Forms 4
L Any Replacement for CDO and MAPI ? Outlook VBA and Custom Forms 6
D using extended MAPI Outlook VBA and Custom Forms 1
Q MAPI Read-only Folder Outlook VBA and Custom Forms 3
D MAPI programming issue - outbox doesn't exist? Outlook VBA and Custom Forms 2
G Send a greeting message to a contact on birthday Outlook VBA and Custom Forms 5
T Outlook creates a copie of every mail I send Using Outlook.com accounts in Outlook 4
R How to restrict GWSMO sync to Outlook Send/Receive cycles Using Outlook 0
pwatts2 Restrict some lists to only BCC send option Outlook Wishlist 2
M Outlook, send to > mail recipient - results in plain text email Using Outlook 1
A Unflag Inbox and Flag Inbox with Orange Category After Item is send Outlook VBA and Custom Forms 3
glnz O365 - How to send from acct 2 but showing email name from acct 1 as From - alias? Using Outlook 0
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0
diver864 vba for a rule to automatically accept meeting requests with 'vacation' in subject, change to all-day event, change to free, don't send reply Outlook VBA and Custom Forms 1

Similar threads

Top