-
One, what is the AddIn add-ins
The AddIn object is an element in the AddIns collection.
The AddIns collection contains all valid add-ins in Word, regardless of whether they are currently loaded.
The AddIns collection is contained in the common template or Word add-in Library (WLL) that is displayed in the templates and Add-Ins dialog box on the Tools menu.
Ii. How to use the AddIn object
To use the AddIn object, we have to use it in a VBA environment. The following is the use of the method, I hope to help you.
Use AddIns (index) to return a single AddIn object, where index refers to the name or index number of the add-in. The spelling of the name must exactly match the display in the templates and Add-Ins dialog box (the case does not have to match). The following example loads the Letter.dot in the form of a common template.
AddIns ("Letter.dot"). Installed = True The index number represents the location of the add-in in the list of add-ins in the templates and Add-ins dialog box. The following instructions show the path of the first valid add-in.
If addins.count >= 1 Then MsgBox Addins (1). Path The following example creates an add-in list at the beginning of the active document. The list contains the name, path, and load state of each valid add-in.
With ActiveDocument.Range (start:=0, end:=0)
. InsertAfter "Name" & VbTab & "Path" & VbTab & "Installed"
. InsertParagraphAfter
For each oaddin in AddIns
. InsertAfter Oaddin.name & VbTab & Oaddin.path & VbTab _
& oaddin.installed
. InsertParagraphAfter
Next oAddIn
. ConvertToTable
End With
Use the Add method to add an add-in to the list of valid add-ons and to load it with the install parameter (optional).
Addins.add filename:= "C:templatesotherletter.dot", Install:=true uses the installed property to load the add-in in the list of valid add-ins.
AddIns ("Letter.dot"). Installed = True Note that the compiled property is used to determine whether the AddIn object is a template or a WLL.