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

programmatically Disable addin



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 22nd 08, 01:38 PM posted to microsoft.public.outlook.program_addins
shubhangi
external usenet poster
 
Posts: 28
Default programmatically Disable addin

hello
I want to disable my addin if certain condition is not met(licence etc.).How
to do this programmatically?I'm using VSTO SE for Outlook 2007.Besides this
I don't want to show
form regions if that condition is not met.If the condition is met then only
my addin is required to
enable & form regions to be shown.Can this be done programmatically?
thanks


Ads
  #2  
Old February 22nd 08, 02:07 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default programmatically Disable addin

Check your license information and if it fails then call to whatever code
you have running when you get the Shutdown() event. You might have to hack
the registry also to remove any form region information.

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


"shubhangi" wrote in message
...
hello
I want to disable my addin if certain condition is not met(licence
etc.).How to do this programmatically?I'm using VSTO SE for Outlook
2007.Besides this I don't want to show
form regions if that condition is not met.If the condition is met then
only my addin is required to
enable & form regions to be shown.Can this be done programmatically?
thanks


  #3  
Old March 3rd 08, 01:42 PM posted to microsoft.public.outlook.program_addins
shubhangi
external usenet poster
 
Posts: 28
Default programmatically Disable addin

Thanks Ken.I did
1.In Application_startup I checked licence and added
Application.COMAddIns.Item("MyAddIn").Connect=Fals e.
2.For not displaying form regions -
Protected Overrides Function RequestService(ByVal serviceGuid As Guid)
As Object
If serviceGuid =
GetType(Microsoft.Office.Interop.Outlook.FormRegio nStartup).GUID Then
If gblbLicence = False Then Return Nothing
ObjFormRegion = New FormRegionHookupVB(Me.Application)
'FormRegionHookupVB implements formregionstartup interface
Return ObjFormRegion
End If
Return MyBase.RequestService(serviceGuid)
End Function
will it have any problem with form region?
Thanks again


"Ken Slovak - [MVP - Outlook]" wrote in message
...
Check your license information and if it fails then call to whatever code
you have running when you get the Shutdown() event. You might have to hack
the registry also to remove any form region information.

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


"shubhangi" wrote in message
...
hello
I want to disable my addin if certain condition is not met(licence
etc.).How to do this programmatically?I'm using VSTO SE for Outlook
2007.Besides this I don't want to show
form regions if that condition is not met.If the condition is met then
only my addin is required to
enable & form regions to be shown.Can this be done programmatically?
thanks




  #4  
Old March 3rd 08, 02:04 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default programmatically Disable addin

That should be OK, but be aware that if the user opens an item with the
message class specified in the registry for your form region that your addin
will become enabled and start from the Startup() event all over again. The
only way to prevent that would be to hack the registry and delete your entry
for the form region.

I'd probably write out the form region information to the registry if the
license check passed and delete it if the license test failed.

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


"shubhangi" wrote in message
...
Thanks Ken.I did
1.In Application_startup I checked licence and added
Application.COMAddIns.Item("MyAddIn").Connect=Fals e.
2.For not displaying form regions -
Protected Overrides Function RequestService(ByVal serviceGuid As Guid) As
Object
If serviceGuid =
GetType(Microsoft.Office.Interop.Outlook.FormRegio nStartup).GUID Then
If gblbLicence = False Then Return Nothing
ObjFormRegion = New FormRegionHookupVB(Me.Application)
'FormRegionHookupVB implements formregionstartup interface
Return ObjFormRegion
End If
Return MyBase.RequestService(serviceGuid)
End Function
will it have any problem with form region?
Thanks again


  #5  
Old March 4th 08, 01:41 PM posted to microsoft.public.outlook.program_addins
shubhangi
external usenet poster
 
Posts: 28
Default programmatically Disable addin

Thanks again
You are right,the loadbehavior resets again to 3 though
Application.COMAddIns.Item("MyAddIn").Connect=Fals e.
is given in Application_Startup as Form region related entries are present
in registry.
I removed the form region related entries from registry if licence
evaluation failed & added the
same if licence evaluation succeeded as per ur suggestion.Now the addin
remains disabled & form region also not shown.
Thanks once again!

"Ken Slovak - [MVP - Outlook]" wrote in message
...
That should be OK, but be aware that if the user opens an item with the
message class specified in the registry for your form region that your
addin will become enabled and start from the Startup() event all over
again. The only way to prevent that would be to hack the registry and
delete your entry for the form region.

I'd probably write out the form region information to the registry if the
license check passed and delete it if the license test failed.

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


"shubhangi" wrote in message
...
Thanks Ken.I did
1.In Application_startup I checked licence and added
Application.COMAddIns.Item("MyAddIn").Connect=Fals e.
2.For not displaying form regions -
Protected Overrides Function RequestService(ByVal serviceGuid As Guid) As
Object
If serviceGuid =
GetType(Microsoft.Office.Interop.Outlook.FormRegio nStartup).GUID Then
If gblbLicence = False Then Return Nothing
ObjFormRegion = New FormRegionHookupVB(Me.Application)
'FormRegionHookupVB implements formregionstartup interface
Return ObjFormRegion
End If
Return MyBase.RequestService(serviceGuid)
End Function
will it have any problem with form region?
Thanks again




 




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
Programmatically assigning categories Jody Outlook and VBA 2 June 17th 08 02:45 AM
Disable Addin runtime Giuseppe Add-ins for Outlook 3 October 9th 07 01:03 PM
Programmatically enable Add-ins balaji chandan Add-ins for Outlook 11 July 18th 07 09:54 PM
How to disable Outlook2003's Junk E-mail filter programmatically Oleg Krasnuhin Outlook - General Queries 0 November 20th 06 10:02 AM
Prevent loading add-in programmatically Wouter Add-ins for Outlook 3 May 19th 06 06:34 PM


All times are GMT +1. The time now is 08:53 AM.


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.