Hi Chango,
Thanks for posting in the community!
From my understanding to this issue, you installed one .net-based com
add-in in word. When you start up the work through automation, the
initialization of this com add-in spent a lot of time which make the
initialization very slow.
There are two types of add-in in word: wll add-in and com add-in, which are
different. I'd suggest one MSDN article will introduce more information
regarding this:
COM Add-ins vs. Application-Specific Add-ins
http://msdn.microsoft.com/library/en-us/odeopg/html/deovrcomaddinsvsapplicat
ionspecificaddins.asp
The /a startup switch is used to disable the wll add-in and global
templates for Word. Com add-in will not be affected.
For the com add-in initialization, based on my experience, I'd suggest
there are two methods for you in this scenario.
1) The method you have mentioned in the above message, you can unregister
the add-in before you starts Word and register it when necessary. As you
have said, this is not very easy for the users.
2) You can disable the com add-in and then enable it when necessary. When
the user exists the word, he should disable the com add-in so that the next
startup initialization will not be affected. This method will be very
helpful in this scenario. You can tell the users to enable or disable the
com add-in manually or control this with automation. I write one VBA code
for you on this.
'Code begin ----------------------------------------------------
Sub EnableorDisableComAddIn()
Dim oCtlAddinMgr As COMAddIns
Dim oCtlAddin As COMAddIn
On Error GoTo ErrHandler
Set oCtlAddinMgr = Application.COMAddIns
For Each oCtlAddin In oCtlAddinMgr
'Please specify the progID of the .net-based com add-in here.
'then set the true/false to the Connect property to enable or
'disable the com add-in
If oCtlAddin.ProgID = "TestAddin.MyAddin" Then
If oCtlAddin.Connect = False Then
oCtlAddin.Connect = True
MsgBox oCtlAddin.ProgID & " " & "connected!"
Else
oCtlAddin.Connect = False
MsgBox oCtlAddin.ProgID & " " & "dis-connected!"
End If
End If
Next
Exit Sub
ErrHandler:
Debug.Print Err.Number & " "; Err.Description
End Sub
'Code end ------------------------------------------------------
If you use the VBA code to control the com add-in loading, The document
open and close event will help you a lot to enable and disable the com
addin. You can take advantage of the document level or application level
event(in the template) to perform the operation.
Please feel free to let me know if you have any further questions. I am
standing by to be of assistance.
Does this answer your question? Thank you for using Microsoft NewsGroup!
Wei-Dong Xu
Microsoft Product Support Services
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.