The Outlook Import/Export wizard is not extensible with an Outlook COM
Add-in. That being said, you can certainly add your own Command Bar
button(s) to launch your own application.
I have tried to apply your suggesion. The CommandBars collection is
certainly burried. I tested my code in the Outlook VBA editor and it
worked. I added the code to my project, created the AddIn, and installed
it. But when Outlook comes up and attempts to load the dll, it throws
error 483 Object Dosen't Support This Property or Method when trying to
add the command bar button.
The code to add the button is below:
Function CreateAddInCommandBarButton(ByVal Application As Object, _
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object) As Office.CommandBarButton
Dim objOtlk As Outlook.Application
Dim cbrMenu As Office.CommandBarControl
Dim ctlBtnAddIn As Office.CommandBarButton
Dim objExp As Outlook.Explorer
On Error GoTo CreateAddInCommandBarButton_Err
Set gobjAppInstance = Application
'Set objOtlk = GetObject(, "outlook.application")
For Each objExp In gobjAppInstance 'objOtlk
If objExp.Caption = "Inbox - Microsoft Outlook" Then
' Return reference to command bar.
Set cbrMenu = objExp.CommandBars("Menu Bar")
' Add button to call add-in from command bar, if it doesn't
' already exist.
' Constants are declared at module level.
' Look for button on command bar.
Set ctlBtnAddIn = cbrMenu.FindControl(Tag:=CTL_KEY)
If ctlBtnAddIn Is Nothing Then
' Add new button.
Set ctlBtnAddIn = cbrMenu.Controls.Add(Type:
=msoControlButton, _
Parameter:=CTL_KEY)
' Set button's Caption, Tag, Style, and OnAction
properties.
With ctlBtnAddIn
.Caption = CTL_CAPTION
.Tag = CTL_KEY
.Style = msoButtonCaption
' Use AddInInst argument to return reference
' to this add-in.
.OnAction = PROG_ID_START & AddInInst.ProgId _
& PROG_ID_END
End With
End If
Exit For
End If
Next objExp
' Return reference to new commandbar button.
Set CreateAddInCommandBarButton = ctlBtnAddIn
CreateAddInCommandBarButton_End:
Set ctlBtnAddIn = Nothing
Set cbrMenu = Nothing
Set objExp = Nothing
Set objOtlk = Nothing
Set gobjAppInstance = Nothing
Exit Function
CreateAddInCommandBarButton_Err:
' Call generic error handler for add-in.
AddInErr err
Resume CreateAddInCommandBarButton_End
End Function
As you can see, I have also tried getting to Outlook application to add
the command bar to no avail. The core functionality works in the VBA
editor as I said. I don't know what to look for and I havent found a way
to step throught the code in debug mode to find the exact point of
failure. If I could even do that I could probably fix it.
Can anyone see a problem in the code? Any help is appreciated.
TIA
Dave Phelan
Pitman