10-11-2007 01:09 AM
10-11-2007 04:08 PM
10-12-2007 04:11 AM
10-15-2007 03:02 AM
10-15-2007 05:29 AM
10-16-2007 12:25 AM
Disable option to open a PST(File -- Open -- Outlook Data File: 5576
Disable Data File Management - 7091
Disable File Archive 1886
10-16-2007 12:29 AM
Sub EnumCommandBars()
Dim objOL As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objDrafts As Outlook.MAPIFolder
Dim objPost As Outlook.PostItem
Dim colCB As Office.CommandBars
Dim objCB As Office.CommandBar
Dim strWindow As String
Dim strExplBars As String
Dim strInspBars As String
Dim strText As String
Dim arrBars() As String
Dim i As Integer
On Error Resume Next
Set objOL = Application
Set objNS = objOL.Session
Set objDrafts = objNS.GetDefaultFolder(olFolderDrafts)
strExplBars = "Menu Bar,Standard,Advanced,Web"
strInspBars = "Menu Bar,Standard,Form Design,Formatting"
strWindow = TypeName(objOL.ActiveWindow)
Select Case strWindow
Case "Explorer"
Set colCB = objOL.ActiveExplorer.CommandBars
arrBars = Split(strExplBars, ",")
Case "Inspector"
Set colCB = objOL.ActiveInspector.CommandBars
arrBars = Split(strInspBars, ",")
End Select
If Not colCB Is Nothing Then
Set objPost = objDrafts.Items.Add("IPM.Post")
objPost.Subject = "CommandBars for " & strWindow & _
": " & colCB.Parent.Caption
objPost.BodyFormat = olFormatPlain
For i = 0 To UBound(arrBars)
Set objCB = colCB.item(arrBars(i))
Call EnumOneBar(objCB, strText)
strText = strText & vbCrLf & "===========" & vbCrLf
Next
objPost.Body = Mid(strText, 5)
objPost.Save
objPost.Display
End If
Set objOL = Nothing
Set objNS = Nothing
Set objDrafts = Nothing
Set objPost = Nothing
Set colCB = Nothing
Set objCB = Nothing
End Sub
Sub EnumOneBar(cb As Office.CommandBar, ByRef postText)
Dim objControl As Office.CommandBarControl
Dim objPopupControl As Office.CommandBarPopup
postText = postText & vbCrLf & vbCrLf & "CommandBar: " & cb.Name
For Each objControl In cb.Controls
If objControl.BuiltIn = True Then
Select Case objControl.Type
Case msoControlPopup, _
msoControlButtonPopup, _
msoControlGraphicPopup, _
msoControlSplitButtonPopup
postText = postText & vbCrLf & vbCrLf & _
objControl.Caption & _
" (Submenu) - " & objControl.ID
Set objPopupControl = objControl
Call EnumOneBar( _
objPopupControl.CommandBar, postText)
Case Else
postText = postText & vbCrLf & vbTab & _
objControl.Caption & " - " & objControl.ID
End Select
End If
Next
Set objControl = Nothing
Set objPopupControl = Nothing
End Sub
10-16-2007 12:34 AM
10-16-2007 12:38 AM
10-16-2007 03:47 AM
10-16-2007 04:46 AM