AddIn class

The contract every addin’s main class must implement. One read-only property — Name — that the IDE reads to label the addin in error messages, log lines, and any addin-management UI added later. The IDE never creates an AddIn itself; the addin DLL constructs the object inside tbCreateCompilerAddin and returns it.

Private Class MyAddIn
    Implements AddIn

    Private WithEvents Host As Host

    Public Sub New(ByVal Host As Host)
        Set Me.Host = Host
    End Sub

    Private Property Get AddIn_Name() As String
        Return "My AddIn"
    End Property
End Class

The class implementing AddIn is also the natural place to hold every other WithEvents reference the addin uses (Host, each Button, each ToolWindow, an optional AddinTimer, …) — its lifetime is tied to the addin’s loaded state.

An addin that needs a newer IDE than the one that loads it can return the package’s UnsupportedHostAddin, an AddIn that does nothing.

Properties

Name

A short human-readable name for the addin. String, read-only. The IDE captures this once when the addin is loaded. The Add-Ins menu lists the addin under it; an empty name is drawn as a separator line.

Syntax: addIn.Name As String