A
allan rees-bevan
Bit of a crucial problem..
I have tried several different ways to add a popup menu to the Outlook XP Menu Bar, with a button off that which calls a form. This needs to be districuted to 700 users, so the VBAProject.OTM option (which was my initial one) is out
Using a com add-in, I can get as far as adding the popup menu, and the button. When I use ".OnAction = frmConflictCheck.show", it automatically calls the form when Outlook initialises, not just when the button is clicked
My 2 bits of the VB project are the Outlook Designer (Connect.Dsr) and the form (frmConflictCheck)
My general declarations are
================================
Implements IDTExtensibility
Dim WithEvents oApp As Outlook.Applicatio
Dim WithEvents oNS As Outlook.NameSpac
Dim WithEvents oExplorer As Outlook.Explore
================================
The code I'm using in IDTExtensibility2_OnStartupComplete is
================================
Private Sub IDTExtensibility2_OnStartupComplete(
custom() As Variant
On Error Resume Nex
Dim colCB As Office.CommandBar
Dim objCB As Office.CommandBa
Dim objCBMenu As Office.CommandBarPopu
Dim objCBMenuCB As Office.CommandBa
Dim objCBB As Office.CommandBarButto
Dim objPicture As stdole.IPictureDis
'Const strPic As String = "C:\temp\ConflictCheck\mail01.bmp
Set oApp = CreateObject("Outlook.Application"
Set colCB = oApp.ActiveExplorer.CommandBar
Set objCB = colCB.Item("Menu Bar"
MsgBox ("Allan Initialising..."
If objCB.Controls.Item(7).Caption = "Ma&sons" The
objCB.Controls.Item(7).Delet
MsgBox ("Allan Deleted Menu..."
Els
Set objCBMenu = objCB.Controls.Add(Type:=msoControlPopup,
Before:=7, Temporary:=True
With objCBMen
.Caption = "Ma&sons
Set objCBMenuCB = .CommandBa
Set objCBB = objCBMenuCB.Controls.Add(Type:=msoControlButton,
Temporary:=True
objCBB.Caption = "&Conflict Check
'Set objPicture = LoadPicture(strPic
'objCBB.Picture = objPictur
'objCBB.Picture = LoadPicture("c:\temp\conflictcheck\mail01.bmp"
objCBB.OnAction = frmConflictCheck.Sho
End Wit
MsgBox ("Allan Added Menu..."
Set oApp = Nothin
Set colCB = Nothin
Set objCB = Nothin
Set objCBMenu = Nothin
Set objCBMenuCB = Nothin
Set objCBB = Nothin
End I
End Su
==================================
What am I missing?! My secondar problem, which you'll be able to see in the code above, is that I can't, for the life of me, assign the picture property to the button..
ANY help at all will be HUGELY appreciated..
Allan
I have tried several different ways to add a popup menu to the Outlook XP Menu Bar, with a button off that which calls a form. This needs to be districuted to 700 users, so the VBAProject.OTM option (which was my initial one) is out
Using a com add-in, I can get as far as adding the popup menu, and the button. When I use ".OnAction = frmConflictCheck.show", it automatically calls the form when Outlook initialises, not just when the button is clicked
My 2 bits of the VB project are the Outlook Designer (Connect.Dsr) and the form (frmConflictCheck)
My general declarations are
================================
Implements IDTExtensibility
Dim WithEvents oApp As Outlook.Applicatio
Dim WithEvents oNS As Outlook.NameSpac
Dim WithEvents oExplorer As Outlook.Explore
================================
The code I'm using in IDTExtensibility2_OnStartupComplete is
================================
Private Sub IDTExtensibility2_OnStartupComplete(
custom() As Variant
On Error Resume Nex
Dim colCB As Office.CommandBar
Dim objCB As Office.CommandBa
Dim objCBMenu As Office.CommandBarPopu
Dim objCBMenuCB As Office.CommandBa
Dim objCBB As Office.CommandBarButto
Dim objPicture As stdole.IPictureDis
'Const strPic As String = "C:\temp\ConflictCheck\mail01.bmp
Set oApp = CreateObject("Outlook.Application"
Set colCB = oApp.ActiveExplorer.CommandBar
Set objCB = colCB.Item("Menu Bar"
MsgBox ("Allan Initialising..."
If objCB.Controls.Item(7).Caption = "Ma&sons" The
objCB.Controls.Item(7).Delet
MsgBox ("Allan Deleted Menu..."
Els
Set objCBMenu = objCB.Controls.Add(Type:=msoControlPopup,
Before:=7, Temporary:=True
With objCBMen
.Caption = "Ma&sons
Set objCBMenuCB = .CommandBa
Set objCBB = objCBMenuCB.Controls.Add(Type:=msoControlButton,
Temporary:=True
objCBB.Caption = "&Conflict Check
'Set objPicture = LoadPicture(strPic
'objCBB.Picture = objPictur
'objCBB.Picture = LoadPicture("c:\temp\conflictcheck\mail01.bmp"
objCBB.OnAction = frmConflictCheck.Sho
End Wit
MsgBox ("Allan Added Menu..."
Set oApp = Nothin
Set colCB = Nothin
Set objCB = Nothin
Set objCBMenu = Nothin
Set objCBMenuCB = Nothin
Set objCBB = Nothin
End I
End Su
==================================
What am I missing?! My secondar problem, which you'll be able to see in the code above, is that I can't, for the life of me, assign the picture property to the button..
ANY help at all will be HUGELY appreciated..
Allan