way to check if com addin is available before starting outlook and making sure user does not remove

  • Thread starter Thread starter Martin Nemzow
  • Start date Start date
M

Martin Nemzow

for security reasons I need to make certain outlook does not start without
com addin and that user does not try to unload it from outlook.

Ideas?
 
You can write code to check the COMAddins collection for your COMAddin
object of interest and then check the .Connect Boolean property of
that COMAddin object. The COM addin can also use the On_Disconnection
event and see which method was used to disconnect the addin. If
RemoveMode = ext_dm_UserClosed then the user disconnected the addin.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
Thanks Ken.


Ken Slovak - said:
You can write code to check the COMAddins collection for your COMAddin
object of interest and then check the .Connect Boolean property of
that COMAddin object. The COM addin can also use the On_Disconnection
event and see which method was used to disconnect the addin. If
RemoveMode = ext_dm_UserClosed then the user disconnected the addin.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


Martin Nemzow said:
for security reasons I need to make certain outlook does not start without
com addin and that user does not try to unload it from outlook.

Ideas?
 
not quite... If the COM addin is not loaded, its code to check whether
itself is loaded is not available and cannot run. Is there an external way
to check whether the addin is loaded outside of outlook and loading when
Outlook loads?


Ken Slovak - said:
You can write code to check the COMAddins collection for your COMAddin
object of interest and then check the .Connect Boolean property of
that COMAddin object. The COM addin can also use the On_Disconnection
event and see which method was used to disconnect the addin. If
RemoveMode = ext_dm_UserClosed then the user disconnected the addin.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


Martin Nemzow said:
for security reasons I need to make certain outlook does not start without
com addin and that user does not try to unload it from outlook.

Ideas?
 
Whether the code is in a standalone app or a COM addin you still would
have to check the COMAddins collection and the Connect bit. A
standalone app would use an event like Application.Startup. You'd
still have to check for existing Explorers though because a properly
written COM addin won't initialize if no Explorers are present.

You could also put the code in the Outlook VBA project to run in
ThisOutlookSession in the Startup event handler.

You can also check the LoadBehavior value in the Connect key for the
addin to see if it's 3, which means loads on startup.
 
thanks.


Ken Slovak - said:
Whether the code is in a standalone app or a COM addin you still would
have to check the COMAddins collection and the Connect bit. A
standalone app would use an event like Application.Startup. You'd
still have to check for existing Explorers though because a properly
written COM addin won't initialize if no Explorers are present.

You could also put the code in the Outlook VBA project to run in
ThisOutlookSession in the Startup event handler.

You can also check the LoadBehavior value in the Connect key for the
addin to see if it's 3, which means loads on startup.
 
Back
Top