You're correct in that nothing is bulletproof with determined and/or incompetent users, but you can check to see what add-in's are running and change their state. We have an 'Autorun' rule that is built into our templates that (among other things) we use to check/set application settings and manage some add-ins. Below I've put the basic code we use to check for addins that we do and don't want running. Since we already have any opened file running this Autorun rule w/ an event trigger, it works well for us. You could also build it into an Add-In, but you'd still have to make sure your addin is installed and being run on every computer. We have the autorun rule phone home (just hits an API endpoint with the filename, user name, date/time) to make sure it's being run everywhere and run a heartbeat check on it to make sure all users have things reporting everyday they're in office. Again, this might take it outside the useful window for your application, but it's an option. Good luck!
Sub VerifyAddIns()
Dim badAddIns As New List(Of String) From { "{48B682BC-42E6-4953-84C5-3D253B52E7AA}" } ' Bad Add-Ins
Dim requiredAddIns As New List(Of String) From { "{48B682BC-42E6-4953-84C5-3D253B52E77B}" } ' Required Add-Ins
For Each addIn As ApplicationAddIn In ThisApplication.ApplicationAddIns
If addIn.Activated AndAlso badAddIns.Contains(addIn.ClientId) Then
Logger.Info("Disabling AddIn " & addIn.DisplayName)
addIn.LoadAutomatically = False
addIn.Deactivate()
ElseIf Not addIn.Activated AndAlso requiredAddIns.Contains(addIn.ClientId) Then
Logger.Info("Enabling AddIn " & addIn.DisplayName)
addIn.LoadAutomatically = True
addIn.Activate
End If
Next addIn
End Sub 'VerifyAddIns
If this solved your problem, or answered your question, please click Accept Solution.