Identify application

C

cozy_dude

Hello!

I'm developing an universal office add-in, which will be able to work
with most of office applications.
I want to know how can I identify the application, which has loaded my
add-in (For example in OnConnection method.). I need this information,
because each application has its own object model.

Simple method is to call GetModuleFileName. But I don't like this
solution, since it's not very safe - user can
 
K

Ken Slovak - [MVP - Outlook]

Check the Name property of the Application object passed in the
On_Connection event.
 
S

Sigurd Stenersen

I'm developing an universal office add-in, which will be able to work
with most of office applications.
I want to know how can I identify the application, which has loaded my
add-in (For example in OnConnection method.). I need this information,
because each application has its own object model.

Simple method is to call GetModuleFileName. But I don't like this
solution, since it's not very safe - user can

The cleanest solution is to offer one COM class for each host. You can
include several COM classes in one .dll.


Sigurd
 
C

cozy_dude

Ken Slovak - [MVP - Outlook] напиÑав:
Check the Name property of the Application object passed in the
On_Connection event.

I can't use the Name property before I have queried for a concrete
application interface.
Your advise flashed me on an idea. I will simply consequently ask the
IDispatch for every possible interface (Word, Excel, etc) until it
returns me a correct one.

Thank a lot.
 

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