Erays
04-13-2005, 02:22 PM
Sub BuildEdsMenuItem()
EdsMenu "Create Rei Folders", "MakeEdsFolder"
EdsMenu "Initial Email and Save", "EmailRei"
EdsMenu "Supplement Email and Save", "EmailSupp"
EdsMenu "TotalLoss Email and Save", "EmailTLA"
EdsMenu "Save Initial Rei", "SaveRei"
EdsMenu "Save Supplement Rei", "SaveSupp"
EdsMenu "Save Total Loss Rei", "SaveTotal"
End Sub
Public Function EdsMenu(vCaption As String, vOnAction As String)
Dim ctrl As CommandBarControl
On Error Resume Next
Application.CommandBars("Tools").Controls(vCaption).Delete
On Error GoTo 0
With Application.CommandBars("Worksheet Menu Bar").Controls("Tools").Controls.Add
.Caption = vCaption
.OnAction = vOnAction
End With
End Function
Sub DeleteEdsMenuItem()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "Create Rei Folders" Then ctrl.Delete
Next
DeleteEdsMenuItem1
End Sub
Sub DeleteEdsMenuItem1()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "Initial Email and Save" Then ctrl.Delete
Next
DeleteEdsMenuItem2
End Sub
Sub DeleteEdsMenuItem2()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "Supplement Email and Save" Then ctrl.Delete
Next
DeleteEdsMenuItem3
End Sub
Sub DeleteEdsMenuItem3()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "TotalLoss Email and Save" Then ctrl.Delete
Next
DeleteEdsMenuItem4
End Sub
Sub DeleteEdsMenuItem4()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "Save Initial Rei" Then ctrl.Delete
Next
DeleteEdsMenuItem5
End Sub
Sub DeleteEdsMenuItem5()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "Save Supplement Rei" Then ctrl.Delete
Next
DeleteEdsMenuItem6
End Sub
Sub DeleteEdsMenuItem6()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "Save Total Loss Rei" Then ctrl.Delete
Next
End Sub
EdsMenu "Create Rei Folders", "MakeEdsFolder"
EdsMenu "Initial Email and Save", "EmailRei"
EdsMenu "Supplement Email and Save", "EmailSupp"
EdsMenu "TotalLoss Email and Save", "EmailTLA"
EdsMenu "Save Initial Rei", "SaveRei"
EdsMenu "Save Supplement Rei", "SaveSupp"
EdsMenu "Save Total Loss Rei", "SaveTotal"
End Sub
Public Function EdsMenu(vCaption As String, vOnAction As String)
Dim ctrl As CommandBarControl
On Error Resume Next
Application.CommandBars("Tools").Controls(vCaption).Delete
On Error GoTo 0
With Application.CommandBars("Worksheet Menu Bar").Controls("Tools").Controls.Add
.Caption = vCaption
.OnAction = vOnAction
End With
End Function
Sub DeleteEdsMenuItem()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "Create Rei Folders" Then ctrl.Delete
Next
DeleteEdsMenuItem1
End Sub
Sub DeleteEdsMenuItem1()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "Initial Email and Save" Then ctrl.Delete
Next
DeleteEdsMenuItem2
End Sub
Sub DeleteEdsMenuItem2()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "Supplement Email and Save" Then ctrl.Delete
Next
DeleteEdsMenuItem3
End Sub
Sub DeleteEdsMenuItem3()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "TotalLoss Email and Save" Then ctrl.Delete
Next
DeleteEdsMenuItem4
End Sub
Sub DeleteEdsMenuItem4()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "Save Initial Rei" Then ctrl.Delete
Next
DeleteEdsMenuItem5
End Sub
Sub DeleteEdsMenuItem5()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "Save Supplement Rei" Then ctrl.Delete
Next
DeleteEdsMenuItem6
End Sub
Sub DeleteEdsMenuItem6()
Dim ctrl As CommandBarControl
For Each ctrl In Application.CommandBars("Worksheet Menu Bar") _
.Controls("Tools").Controls
If ctrl.Caption = "Save Total Loss Rei" Then ctrl.Delete
Next
End Sub