How should my add-in behave when launching outlook as OLE server?

T

tomer

Hi,
My add in display a message when outlook is starting,i wonder what should it
do
in case outlook runs as OLE server?

How should i check if outlook run as OLE server at all?,is inspecting the
command line
is enough?


thanks in advance.
 
D

Dmitry Streblechenko \(MVP\)

There is really no difference between the two modes. If you start Outlook in
the UI mode, it will serve as the COM server. If you start Outlook as a COM
server programmatically (and it hasn't been running before) and then start
Outlook through the UI, it will use the same instance of the outlook.exe
process. Check with the Task Manager - there is always only once instance of
outlook.exe running.
If you mean Outlook running as a process without any UI, you can check the
Application.Explorers.Count and Application.Inspectors.Count.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
T

tomer

Yes i ment outlook is running as a process(OLE SERVER) with out UI,
In that case,i guess that my add in should be loaded, but i need to stop any
processing as my add in
display some messages and wait for user response

BTW Dmitry,do you know which COM interface an object should implements in
order that
it can be sent as attachment?

I have created an ATL object,and tried to attach it to an outlook message,
it seems that OUTLOOK invoke a method\property with DISPID(i dont think it
is MAPIOBJECT) that i could not find in the type library.

Thanks.
 
T

tomer

mmmm....just like i can send a contact as an attachment,i tried to send my
own COM object as an attachment

something like this:

'Create my MFC com object

MyContact* c=new MyContact;

// Prepare a new mail message

_MailItem olMail(olApp.CreateItem(0));
Attachments atts(olMail.GetAttachments());

VARIANT Source;
Source.pdispVal=c->GetIDispatch(true);
Source.vt=VT_DISPATCH;

:
:

//add our object let's see what interface he is looking for

atts.Add(Source,vtType,vtPosition,vtDisplayName);

Than i put a break point in the IDisptach:Invoke in order to see what
property or method outlook is using,
I expect outlook will query for some IStreamXXX interface?.
the DISPID which outlook search for,cannot be found in the type library
( i am using OLEVIEW)

Thanks in advance.
 
D

Dmitry Streblechenko \(MVP\)

When you send a contact as an attachment, Outlook attaches the contact
(which is just a regular message to Outlook) as an embedded message
attachment (PR_ATTACH_METHOD == ATTACH_EMBEDDED_MSG).
To can do the same as long as the attachment is a message, which can be a
regular message, contact, task, etc.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
T

tomer

Thanks.

Dmitry Streblechenko (MVP) said:
When you send a contact as an attachment, Outlook attaches the contact
(which is just a regular message to Outlook) as an embedded message
attachment (PR_ATTACH_METHOD == ATTACH_EMBEDDED_MSG).
To can do the same as long as the attachment is a message, which can be a
regular message, contact, task, etc.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


think
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top