A
Allan Rees-Bevan
Hi all, trying to programmatically, on Outlook XP startup, add extra menu to
Menu Bar with drop down, and assign macro to button - this is what I have,
cribbed from a Word XP template I had a hand in, but nothing happens, Allan:
================================
Public Sub AutoExec()
AddMasonsMenu
End Sub
================================
Public Function AddMasonsMenu() As Boolean
On Error Resume Next
Dim objCBar As CommandBar
Dim objCBCtrl As CommandBarControl
Dim objInsMenu As CommandBar
Dim objCVMenu As CommandBar
Dim objTBMenu As CommandBar
Dim objTBOMenu As CommandBar
Dim strCaption As String
Dim strTag As String
Dim strCBName As String
Dim strOnAction As String
Dim strTip As String
Dim intType As Integer
Dim intControlsCount As Integer
Dim blnNeedSave As Boolean
If CommandBars("Menu Bar").FindControl(msoControlPopup, , "Masons",
True) Is Nothing Then
strCaption = "&Masons"
strTag = "Masons"
Set objCBar = AddMenu(strCaption, strTag)
strCBName = "Masons"
blnNeedSave = True
End If
Set objCBar = CommandBars("Menu Bar").Controls("Masons").CommandBar
Set objCBCtrl = AddCBarControl(objCBar, "&Conflict Checking",
msoControlButton, _
"modConflictCheck.CallCompForm", "CallCompForm", "")
End Function
================================
Public Sub CallCompForm()
frmConflictCheck.Show
End Sub
================================
Menu Bar with drop down, and assign macro to button - this is what I have,
cribbed from a Word XP template I had a hand in, but nothing happens, Allan:
================================
Public Sub AutoExec()
AddMasonsMenu
End Sub
================================
Public Function AddMasonsMenu() As Boolean
On Error Resume Next
Dim objCBar As CommandBar
Dim objCBCtrl As CommandBarControl
Dim objInsMenu As CommandBar
Dim objCVMenu As CommandBar
Dim objTBMenu As CommandBar
Dim objTBOMenu As CommandBar
Dim strCaption As String
Dim strTag As String
Dim strCBName As String
Dim strOnAction As String
Dim strTip As String
Dim intType As Integer
Dim intControlsCount As Integer
Dim blnNeedSave As Boolean
If CommandBars("Menu Bar").FindControl(msoControlPopup, , "Masons",
True) Is Nothing Then
strCaption = "&Masons"
strTag = "Masons"
Set objCBar = AddMenu(strCaption, strTag)
strCBName = "Masons"
blnNeedSave = True
End If
Set objCBar = CommandBars("Menu Bar").Controls("Masons").CommandBar
Set objCBCtrl = AddCBarControl(objCBar, "&Conflict Checking",
msoControlButton, _
"modConflictCheck.CallCompForm", "CallCompForm", "")
End Function
================================
Public Sub CallCompForm()
frmConflictCheck.Show
End Sub
================================