Solved

How to properly Install and uninstall WORD 2003 COM Add-ins

Posted on 2009-07-13
3
264 Views
Last Modified: 2012-08-13
I have made a COM Add-in with VB6.  This Add-in has what I think is a pretty standard start-up procedure of adding a button to the standard WORD 2003 Commandbar.

I register my .dll with regsvr32 and it works fine.  My problem is that if I unregister it, the button is still there in Word. (but does nothing)

I have also made an Add-in for outlook and if I unregister it then the button is also gone when I next open outlook.  I am expecting this also to happen with Word but it is not.

I am aware that the add-in has a "connect" entry in the registry under software/microsoft/office/word/add-ins and this entry is gone.  But I still get the button.
0
Comment
Question by:darbid73
  • 3
3 Comments
 
LVL 19

Author Comment

by:darbid73
ID: 24838257
I think it has something to do with it being still in normal.dot?????

If I reset the commandbar then it is gone - but I need a better solution then that.
0
 
LVL 19

Author Comment

by:darbid73
ID: 24838958
It appears I did not ad the code here it is.

If I delete normal.dot the button is gone, but obviously I cannot do that every time.

Dim oPic As stdole.IPictureDisp
Dim oMask As stdole.IPictureDisp
 
 
'<LOAD THE PICTURE AND MASK OBJECTS>
 
 
Set oPic = LoadResPicture(101, vbResBitmap)
Set oMask = LoadResPicture(102, vbResBitmap)
 
Set wLuTTool = w_App.CommandBars.Item("Standard").FindControl(, , "890", False, True)
 
If TypeName(wLuTTool) = "Nothing" Then
    Set wLuTTool = w_App.CommandBars.Item("Standard").Controls.Add(msoControlButton, , "890", , True)
End If
 
 
With wLuTTool
    .BeginGroup = True
    .DescriptionText = "Add selected Word Document"
    .Caption = "LuTTool"
    .Enabled = True
    .OnAction = "!<W2LTT2I.Connect>"
    .Style = msoButtonIconAndCaption
    .Picture = oPic  '<OFFICE 2000 - 2007>
    .Mask = oMask '<OFFICE 2002 - 2007>
    .Tag = "890"
    .ToolTipText = "ToolTip"
    .Visible = True
End With
 
Set oPic = Nothing
Set oMask = Nothing
 
Private Sub IDTExtensibility2_OnBeginShutdown(custom() As Variant)
 
    'The OnBeginShutdown method is called while the environment is being shut down. The custom parameter is an array
    'that can be used to provide additional data to the OnBeginShutdown method if desired.
    
    
    If TypeName(wLuTTool) <> "Nothing" Then
        wLuTTool.Delete False
    End If
 
    Set wLuTTool = Nothing
 
 
End Sub

Open in new window

0
 
LVL 19

Accepted Solution

by:
darbid73 earned 0 total points
ID: 24881208
Ok got it sorted out.  You have to save the normal.dot after deleting the button.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to update a sql 2012 database table with the time difference from 2 time frames in vb.net 2010 4 83
Hide vba in gp 7 93
Need a poor man's PowerPoint 5 104
Help me. 3 54
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question