Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove Right Click Print Context Menu from Outlook 2007

Is there any way that I can remove the Print item from the context menu when you right-click on an email with VBA?

I am forever right-clicking to reply to an email, only to accidentally click Print and have Outlook send it directly to the printer quicker than I can stop it.

alt text

NB: I am using Outlook 2007.

like image 917
GateKiller Avatar asked Sep 23 '08 15:09

GateKiller


People also ask

How do I turn off quick print right click in Outlook?

Via File-> Options-> Customize Ribbon, you can remove the Actions group from the Attachments tab and add a new group of your own. You can then add the commands that you want to have available to you. This allows you to recreate the default Actions group but then without the Quick Print button.


1 Answers

Based on the link TcKs provide, that was pretty simple. In the example below I check the type of the item so that it only affects e-mails and not calendar items. To enter the code in outlook, Type Alt + F11, then expand the Microsoft Office Outlook Objects in the Project pane. Then double click the ThisOutlookSession. Then paste this code into the code window. I don't like to check captions like this as you can run into issues with internationalization. But I didn't see an ActionID or anything on the Command. There was a FaceID but that is just the id of the printer icon.

Private Sub Application_ItemContextMenuDisplay(ByVal CommandBar As Office.CommandBar, ByVal Selection As Selection)

   Dim cmdTemp As Office.CommandBarControl

   If Selection.Count > 0 Then

      Select Case TypeName(Selection.Item(1))

         Case "MailItem"

            For Each cmdTemp In CommandBar.Controls

               If cmdTemp.Caption = "&Print" Then

                  cmdTemp.Delete
                  Exit For

               End If

            Next cmdTemp

         Case Else

            'Debug.Print TypeName(Selection.Item(1))

      End Select

   End If

End Sub
like image 67
Will Rickards Avatar answered Nov 11 '22 04:11

Will Rickards