View Single Post
 
Old 06-15-2017, 03:26 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Something like this:

Code:
Option Explicit
Sub DisconnetCOMAI()
Dim lngIndex As Long
Dim oCAIs As COMAddIns
  Set oCAIs = Application.COMAddIns
  For lngIndex = 1 To oCAIs.Count
    If Application.COMAddIns(lngIndex).Description = "Microsoft Word Code Compatibility Inspector" Then
      Application.COMAddIns(lngIndex).Connect = False
      Exit For
    End If
  Next
End Sub
Sub ConnectCOMAI()
Dim lngIndex As Long
Dim oCAIs As COMAddIns
  Set oCAIs = Application.COMAddIns
  For lngIndex = 1 To oCAIs.Count
    If Application.COMAddIns(lngIndex).Description = "Microsoft Word Code Compatibility Inspector" Then
      Application.COMAddIns(lngIndex).Connect = True
      Exit For
    End If
  Next
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote