How to remove (Delete) a Word global template add-in from the Add-ins list?
How can I programmatically delete a single add-in? I don't want to deactivate it (uncheck it), I want to delete it completely. I know the specific name, say "MyTemplate.dotm".
I found the following code posted that supposedly deletes all deactivated add-ins, but what would be the syntax for a specific template?
Code:
Private Sub Delete_UnInstalled_WordAddins()
Dim oAddin As AddIn
On Error GoTo Err_Addin
For Each oAddin In AddIns
If oAddin.Installed = False Then
oAddin.Delete
End If
Next oAddin
Finally:
If Not oAddin Is Nothing Then Set oAddin = Nothing
Err_Addin:
If Err < > 0 Then
Err.Clear
GoTo Finally
End If
End Sub