AdxContextMenu1 doesn't appear any more (also can't add an image)

Add-in Express™ Support Service
That's what is more important than anything else

AdxContextMenu1 doesn't appear any more (also can't add an image)
 
Johnnyxp64




Posts: 87
Joined: 2011-05-13
i think this happened after i upgrade to latest Release 7.6.4084
or after i edit the AddinModule.vb to make some attachments function based on your documentation work.

the point is my AdxContextMenu1 is not visible anymore when i right click an email :(

i am posting my AddinModule.vb content that may help you find the reason...

p.s also i cant add an image to the root context menu, there is no image property...how do i do that?

thanks

User added an image


Imports System.Runtime.InteropServices
Imports System.ComponentModel
Imports System.Windows.Forms
Imports AddinExpress.MSO
Imports Outlook = Microsoft.Office.Interop.Outlook

'Add-in Express Add-in Module
<GuidAttribute("7CFD8657-F277-4518-93CB-929EE42A7F69"), ProgIdAttribute("rLookAddin.AddinModule")> _
Public Class AddinModule
    Inherits AddinExpress.MSO.ADXAddinModule
    Friend WithEvents AdxRibbonTab1 As AddinExpress.MSO.ADXRibbonTab
    Friend WithEvents AdxOlFormsManager1 As AddinExpress.OL.ADXOlFormsManager
    Friend WithEvents AdxRibbonGroup1 As AddinExpress.MSO.ADXRibbonGroup
    Friend WithEvents AdxOlFormsCollectionItem1 As AddinExpress.OL.ADXOlFormsCollectionItem
    Friend WithEvents ImageList32 As System.Windows.Forms.ImageList
    Friend WithEvents AdxContextMenu1 As AddinExpress.MSO.ADXContextMenu
    Friend WithEvents AdxCommandBarButton1 As AddinExpress.MSO.ADXCommandBarButton
    Friend WithEvents AdxCommandBarButton2 As AddinExpress.MSO.ADXCommandBarButton
    Friend WithEvents AdxCommandBarButton3 As AddinExpress.MSO.ADXCommandBarButton
    Friend WithEvents AdxCommandBarButton4 As AddinExpress.MSO.ADXCommandBarButton
    Friend WithEvents AdxCommandBarPopup1 As AddinExpress.MSO.ADXCommandBarPopup
    Friend WithEvents ImageList16 As System.Windows.Forms.ImageList
    Friend WithEvents AdxOlFormsCollectionItem2 As AddinExpress.OL.ADXOlFormsCollectionItem
    Friend WithEvents AdxRibbonButton5 As AddinExpress.MSO.ADXRibbonButton
    Friend WithEvents AdxOlFormsCollectionItem3 As AddinExpress.OL.ADXOlFormsCollectionItem
    Public WithEvents adxOutlookEvents As AddinExpress.MSO.ADXOutlookAppEvents
    'Public WithEvents OutlookItemsEvents As OutlookItemsEventsClass = Nothing
    'Public WithEvents OutlookFoldersEvents As OutlookFoldersEventsClass = Nothing
    Public WithEvents OutlookItemEvents As OutlookItemEventsClass = Nothing



#Region " Component Designer generated code. "
    'Required by designer
    Private components As System.ComponentModel.IContainer

    'Required by designer - do not modify
    'the following method
    Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(AddinModule))
        Me.AdxRibbonTab1 = New AddinExpress.MSO.ADXRibbonTab(Me.components)
        Me.AdxRibbonGroup1 = New AddinExpress.MSO.ADXRibbonGroup(Me.components)
        Me.AdxRibbonButton5 = New AddinExpress.MSO.ADXRibbonButton(Me.components)
        Me.ImageList32 = New System.Windows.Forms.ImageList(Me.components)
        Me.AdxOlFormsManager1 = New AddinExpress.OL.ADXOlFormsManager(Me.components)
        Me.AdxOlFormsCollectionItem1 = New AddinExpress.OL.ADXOlFormsCollectionItem(Me.components)
        Me.AdxOlFormsCollectionItem2 = New AddinExpress.OL.ADXOlFormsCollectionItem(Me.components)
        Me.AdxOlFormsCollectionItem3 = New AddinExpress.OL.ADXOlFormsCollectionItem(Me.components)
        Me.AdxContextMenu1 = New AddinExpress.MSO.ADXContextMenu(Me.components)
        Me.AdxCommandBarPopup1 = New AddinExpress.MSO.ADXCommandBarPopup(Me.components)
        Me.AdxCommandBarButton4 = New AddinExpress.MSO.ADXCommandBarButton(Me.components)
        Me.ImageList16 = New System.Windows.Forms.ImageList(Me.components)
        Me.AdxCommandBarButton1 = New AddinExpress.MSO.ADXCommandBarButton(Me.components)
        Me.AdxCommandBarButton3 = New AddinExpress.MSO.ADXCommandBarButton(Me.components)
        Me.AdxCommandBarButton2 = New AddinExpress.MSO.ADXCommandBarButton(Me.components)
        Me.adxOutlookEvents = New AddinExpress.MSO.ADXOutlookAppEvents(Me.components)
        '
        'AdxRibbonTab1
        '
        Me.AdxRibbonTab1.Caption = "r-evolution"
        Me.AdxRibbonTab1.Controls.Add(Me.AdxRibbonGroup1)
        Me.AdxRibbonTab1.Id = "adxRibbonTab_aea606633ce64a6481d2b36d6d02acdc"
        Me.AdxRibbonTab1.Ribbons = CType(((AddinExpress.MSO.ADXRibbons.msrOutlookMailRead Or AddinExpress.MSO.ADXRibbons.msrOutlookMailCompose) _
            Or AddinExpress.MSO.ADXRibbons.msrOutlookExplorer), AddinExpress.MSO.ADXRibbons)
        Me.AdxRibbonTab1.Shared = True
        '
        'AdxRibbonGroup1
        '
        Me.AdxRibbonGroup1.Caption = "Actions"
        Me.AdxRibbonGroup1.Controls.Add(Me.AdxRibbonButton5)
        Me.AdxRibbonGroup1.Id = "adxRibbonGroup_06069fb1ea0146b989ba15183b5d24a6"
        Me.AdxRibbonGroup1.ImageTransparentColor = System.Drawing.Color.Transparent
        Me.AdxRibbonGroup1.Ribbons = CType(((AddinExpress.MSO.ADXRibbons.msrOutlookMailRead Or AddinExpress.MSO.ADXRibbons.msrOutlookMailCompose) _
            Or AddinExpress.MSO.ADXRibbons.msrOutlookExplorer), AddinExpress.MSO.ADXRibbons)
        '
        'AdxRibbonButton5
        '
        Me.AdxRibbonButton5.Caption = "Settings"
        Me.AdxRibbonButton5.Id = "adxRibbonButton_b05af40678de4adbb102bd7c5d2dd392"
        Me.AdxRibbonButton5.Image = 5
        Me.AdxRibbonButton5.ImageList = Me.ImageList32
        Me.AdxRibbonButton5.ImageTransparentColor = System.Drawing.Color.Transparent
        Me.AdxRibbonButton5.Ribbons = CType(((AddinExpress.MSO.ADXRibbons.msrOutlookMailRead Or AddinExpress.MSO.ADXRibbons.msrOutlookMailCompose) _
            Or AddinExpress.MSO.ADXRibbons.msrOutlookExplorer), AddinExpress.MSO.ADXRibbons)
        Me.AdxRibbonButton5.Size = AddinExpress.MSO.ADXRibbonXControlSize.Large
        '
        'ImageList32
        '
        Me.ImageList32.ImageStream = CType(resources.GetObject("ImageList32.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.ImageList32.TransparentColor = System.Drawing.Color.Transparent
        Me.ImageList32.Images.SetKeyName(0, "ic_launcher_green32.png")
        Me.ImageList32.Images.SetKeyName(1, "contacts32.png")
        Me.ImageList32.Images.SetKeyName(2, "img_plate32.png")
        Me.ImageList32.Images.SetKeyName(3, "mail32.png")
        Me.ImageList32.Images.SetKeyName(4, "notes32.png")
        Me.ImageList32.Images.SetKeyName(5, "login_key_icon32.png")
        '
        'AdxOlFormsManager1
        '
        Me.AdxOlFormsManager1.Items.Add(Me.AdxOlFormsCollectionItem1)
        Me.AdxOlFormsManager1.Items.Add(Me.AdxOlFormsCollectionItem2)
        Me.AdxOlFormsManager1.Items.Add(Me.AdxOlFormsCollectionItem3)
        Me.AdxOlFormsManager1.SetOwner(Me)
        '
        'AdxOlFormsCollectionItem1
        '
        Me.AdxOlFormsCollectionItem1.AlwaysShowHeader = True
        Me.AdxOlFormsCollectionItem1.Cached = AddinExpress.OL.ADXOlCachingStrategy.OneInstanceForAllFolders
        Me.AdxOlFormsCollectionItem1.DefaultRegionState = AddinExpress.OL.ADXRegionState.Minimized
        Me.AdxOlFormsCollectionItem1.ExplorerAllowedDropRegions = AddinExpress.OL.ADXOlExplorerAllowedDropRegions.BottomNavigationPane
        Me.AdxOlFormsCollectionItem1.ExplorerItemTypes = CType(((((AddinExpress.OL.ADXOlExplorerItemTypes.olMailItem Or AddinExpress.OL.ADXOlExplorerItemTypes.olAppointmentItem) _
            Or AddinExpress.OL.ADXOlExplorerItemTypes.olContactItem) _
            Or AddinExpress.OL.ADXOlExplorerItemTypes.olTaskItem) _
            Or AddinExpress.OL.ADXOlExplorerItemTypes.olNoteItem), AddinExpress.OL.ADXOlExplorerItemTypes)
        Me.AdxOlFormsCollectionItem1.ExplorerLayout = AddinExpress.OL.ADXOlExplorerLayout.BottomNavigationPane
        Me.AdxOlFormsCollectionItem1.FormClassName = "rLookAddin.frmLeft"
        Me.AdxOlFormsCollectionItem1.IsDragDropAllowed = True
        '
        'AdxOlFormsCollectionItem2
        '
        Me.AdxOlFormsCollectionItem2.AlwaysShowHeader = True
        Me.AdxOlFormsCollectionItem2.Cached = AddinExpress.OL.ADXOlCachingStrategy.OneInstanceForAllFolders
        Me.AdxOlFormsCollectionItem2.ExplorerAllowedDropRegions = AddinExpress.OL.ADXOlExplorerAllowedDropRegions.FolderView
        Me.AdxOlFormsCollectionItem2.ExplorerItemTypes = CType(((((AddinExpress.OL.ADXOlExplorerItemTypes.olMailItem Or AddinExpress.OL.ADXOlExplorerItemTypes.olAppointmentItem) _
            Or AddinExpress.OL.ADXOlExplorerItemTypes.olContactItem) _
            Or AddinExpress.OL.ADXOlExplorerItemTypes.olTaskItem) _
            Or AddinExpress.OL.ADXOlExplorerItemTypes.olNoteItem), AddinExpress.OL.ADXOlExplorerItemTypes)
        Me.AdxOlFormsCollectionItem2.ExplorerLayout = AddinExpress.OL.ADXOlExplorerLayout.FolderView
        Me.AdxOlFormsCollectionItem2.FormClassName = "rLookAddin.frmCenter"
        Me.AdxOlFormsCollectionItem2.IsDragDropAllowed = True
        Me.AdxOlFormsCollectionItem2.RegionBorder = AddinExpress.OL.ADXRegionBorderStyle.None
        Me.AdxOlFormsCollectionItem2.RestoreFromMinimizedState = True
        '
        'AdxOlFormsCollectionItem3
        '
        Me.AdxOlFormsCollectionItem3.AlwaysShowHeader = True
        Me.AdxOlFormsCollectionItem3.Cached = AddinExpress.OL.ADXOlCachingStrategy.OneInstanceForAllFolders
        Me.AdxOlFormsCollectionItem3.DefaultRegionState = AddinExpress.OL.ADXRegionState.Minimized
        Me.AdxOlFormsCollectionItem3.FormClassName = "rLookAddin.frmRight"
        Me.AdxOlFormsCollectionItem3.InspectorAllowedDropRegions = AddinExpress.OL.ADXOlInspectorAllowedDropRegions.RightSubpane
        Me.AdxOlFormsCollectionItem3.InspectorItemTypes = CType(((((AddinExpress.OL.ADXOlInspectorItemTypes.olRecipient Or AddinExpress.OL.ADXOlInspectorItemTypes.olAppointment) _
            Or AddinExpress.OL.ADXOlInspectorItemTypes.olContact) _
            Or AddinExpress.OL.ADXOlInspectorItemTypes.olMail) _
            Or AddinExpress.OL.ADXOlInspectorItemTypes.olTask), AddinExpress.OL.ADXOlInspectorItemTypes)
        Me.AdxOlFormsCollectionItem3.InspectorLayout = AddinExpress.OL.ADXOlInspectorLayout.RightSubpane
        Me.AdxOlFormsCollectionItem3.IsDragDropAllowed = True
        Me.AdxOlFormsCollectionItem3.UseOfficeThemeForBackground = True
        '
        'AdxContextMenu1
        '
        Me.AdxContextMenu1.CommandBarName = "Context Menu"
        Me.AdxContextMenu1.CommandBarTag = "40f22bb9-bd13-4fd3-a17e-1e40bc9cc0ec"
        Me.AdxContextMenu1.Controls.Add(Me.AdxCommandBarPopup1)
        Me.AdxContextMenu1.SupportedApp = AddinExpress.MSO.ADXOfficeHostApp.ohaOutlook
        Me.AdxContextMenu1.SupportedApps = AddinExpress.MSO.ADXOfficeHostApp.ohaOutlook
        Me.AdxContextMenu1.Temporary = True
        Me.AdxContextMenu1.UpdateCounter = 60
        '
        'AdxCommandBarPopup1
        '
        Me.AdxCommandBarPopup1.Caption = "r-evolution"
        Me.AdxCommandBarPopup1.Controls.Add(Me.AdxCommandBarButton4)
        Me.AdxCommandBarPopup1.Controls.Add(Me.AdxCommandBarButton1)
        Me.AdxCommandBarPopup1.Controls.Add(Me.AdxCommandBarButton3)
        Me.AdxCommandBarPopup1.Controls.Add(Me.AdxCommandBarButton2)
        Me.AdxCommandBarPopup1.ControlTag = "7c7fab28-d481-48d1-a088-24db0734dd3f"
        Me.AdxCommandBarPopup1.Temporary = True
        Me.AdxCommandBarPopup1.UpdateCounter = 12
        '
        'AdxCommandBarButton4
        '
        Me.AdxCommandBarButton4.Caption = "Send to Plate"
        Me.AdxCommandBarButton4.ControlTag = "f01ac8fe-c95a-464c-a362-c62f27522efc"
        Me.AdxCommandBarButton4.Image = 1
        Me.AdxCommandBarButton4.ImageList = Me.ImageList16
        Me.AdxCommandBarButton4.ImageTransparentColor = System.Drawing.Color.LightGray
        Me.AdxCommandBarButton4.Style = AddinExpress.MSO.ADXMsoButtonStyle.adxMsoButtonIconAndCaption
        Me.AdxCommandBarButton4.Temporary = True
        Me.AdxCommandBarButton4.UpdateCounter = 12
        Me.AdxCommandBarButton4.Visible = False
        '
        'ImageList16
        '
        Me.ImageList16.ImageStream = CType(resources.GetObject("ImageList16.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.ImageList16.TransparentColor = System.Drawing.Color.Transparent
        Me.ImageList16.Images.SetKeyName(0, "contacts16.png")
        Me.ImageList16.Images.SetKeyName(1, "img_plate16.png")
        Me.ImageList16.Images.SetKeyName(2, "mail16.png")
        Me.ImageList16.Images.SetKeyName(3, "notes16.png")
        '
        'AdxCommandBarButton1
        '
        Me.AdxCommandBarButton1.Caption = "Add Email to rSpace..."
        Me.AdxCommandBarButton1.ControlTag = "fef0684b-b3aa-4f79-839c-b69996416364"
        Me.AdxCommandBarButton1.Image = 2
        Me.AdxCommandBarButton1.ImageList = Me.ImageList16
        Me.AdxCommandBarButton1.ImageTransparentColor = System.Drawing.Color.LightGray
        Me.AdxCommandBarButton1.Style = AddinExpress.MSO.ADXMsoButtonStyle.adxMsoButtonIconAndCaption
        Me.AdxCommandBarButton1.Temporary = True
        Me.AdxCommandBarButton1.UpdateCounter = 9
        '
        'AdxCommandBarButton3
        '
        Me.AdxCommandBarButton3.Caption = "Add Attachments to rSpace..."
        Me.AdxCommandBarButton3.ControlTag = "81143288-7b08-449f-9192-fa5c6da662d9"
        Me.AdxCommandBarButton3.Image = 3
        Me.AdxCommandBarButton3.ImageList = Me.ImageList16
        Me.AdxCommandBarButton3.ImageTransparentColor = System.Drawing.Color.LightGray
        Me.AdxCommandBarButton3.Style = AddinExpress.MSO.ADXMsoButtonStyle.adxMsoButtonIconAndCaption
        Me.AdxCommandBarButton3.Temporary = True
        Me.AdxCommandBarButton3.UpdateCounter = 6
        '
        'AdxCommandBarButton2
        '
        Me.AdxCommandBarButton2.Caption = "Add Contacts to rContacts"
        Me.AdxCommandBarButton2.ControlTag = "8013f76e-27fd-4780-aef6-3d88a5a67b38"
        Me.AdxCommandBarButton2.Image = 0
        Me.AdxCommandBarButton2.ImageList = Me.ImageList16
        Me.AdxCommandBarButton2.ImageTransparentColor = System.Drawing.Color.LightGray
        Me.AdxCommandBarButton2.Style = AddinExpress.MSO.ADXMsoButtonStyle.adxMsoButtonIconAndCaption
        Me.AdxCommandBarButton2.Temporary = True
        Me.AdxCommandBarButton2.UpdateCounter = 8
        '
        'adxOutlookEvents
        '
        '
        'AddinModule
        '
        Me.AddinName = "rLookAddin"
        Me.SupportedApps = AddinExpress.MSO.ADXOfficeHostApp.ohaOutlook

    End Sub

#End Region

#Region " Add-in Express automatic code "

    'Required by Add-in Express - do not modify
    'the methods within this region

    Public Overrides Function GetContainer() As System.ComponentModel.IContainer
        If components Is Nothing Then
            components = New System.ComponentModel.Container
        End If
        GetContainer = components
    End Function

    <ComRegisterFunctionAttribute()> _
    Public Shared Sub AddinRegister(ByVal t As Type)
        AddinExpress.MSO.ADXAddinModule.ADXRegister(t)
    End Sub

    <ComUnregisterFunctionAttribute()> _
    Public Shared Sub AddinUnregister(ByVal t As Type)
        AddinExpress.MSO.ADXAddinModule.ADXUnregister(t)
    End Sub

    Public Overrides Sub UninstallControls()
        MyBase.UninstallControls()
    End Sub

#End Region

    Public Sub New()
        MyBase.New()

        Application.EnableVisualStyles()
        'This call is required by the Component Designer
        InitializeComponent()

        'Please add any initialization code to the AddinInitialize event handler

    End Sub

    Public Shared Shadows ReadOnly Property CurrentInstance() As AddinModule
        Get
            Return CType(AddinExpress.MSO.ADXAddinModule.CurrentInstance, AddinModule)
        End Get
    End Property

    Public ReadOnly Property OutlookApp() As Outlook._Application
        Get
            Return CType(HostApplication, Outlook._Application)
        End Get
    End Property

    Private Sub AdxRibbonButton5_OnClick(sender As Object, control As AddinExpress.MSO.IRibbonControl, pressed As Boolean) Handles AdxRibbonButton5.OnClick

        Dim f As New frmSettings
        f.ShowDialog()

    End Sub

    Private Sub AddinModule_AddinStartupComplete(sender As System.Object, e As System.EventArgs) Handles MyBase.AddinStartupComplete

        OutlookItemEvents = New OutlookItemEventsClass(Me)

    End Sub

    Private Sub adxOutlookEvents_ExplorerActivate(sender As Object, explorer As Object) Handles adxOutlookEvents.ExplorerActivate
        ConnectToSelectedItem(explorer)
    End Sub

    Private Sub adxOutlookEvents_ExplorerClose(sender As Object, explorer As Object) Handles adxOutlookEvents.ExplorerClose
        Dim count As Integer = 0
        Dim expls As Outlook._Explorers = Nothing

        Try
            expls = OutlookApp.Explorers
            count = expls.Count
        Catch
        Finally
            If expls IsNot Nothing Then
                Marshal.ReleaseComObject(expls)
            End If
        End Try

        If count = 0 Then
            canConnect = False
        End If
    End Sub

    Private Sub adxOutlookEvents_ExplorerSelectionChange(sender As Object, explorer As Object) Handles adxOutlookEvents.ExplorerSelectionChange
        ConnectToSelectedItem(explorer)
    End Sub

    Dim canConnect As Boolean = True
    Private Sub adxOutlookEvents_InspectorActivate(sender As System.Object, inspector As System.Object, folderName As System.String) Handles adxOutlookEvents.InspectorActivate

        If canConnect = True Then
            Dim olInsp As Outlook._Inspector = DirectCast(inspector, Outlook._Inspector)
            Dim item As Object = olInsp.CurrentItem

            If TypeOf item Is Outlook._MailItem Then
                OutlookItemEvents.ConnectTo(item, True)
            End If
        End If

    End Sub

    Private Sub ConnectToSelectedItem(explorer As Object)
        Dim sel As Outlook.Selection = Nothing

        Try
            Dim expl As Outlook._Explorer = TryCast(explorer, Outlook._Explorer)
            sel = expl.Selection
            If sel.Count = 1 Then
                Dim item As Object = sel(1)
                If TypeOf item Is Outlook._MailItem Then
                    OutlookItemEvents.ConnectTo(item, True)
                Else
                    Marshal.ReleaseComObject(item)
                End If
            End If
        Catch
            'temp ignore: missing outlook focus caused the addin to crash find a solution from the control creators
        Finally
            If sel IsNot Nothing Then
                Marshal.ReleaseComObject(sel)
            End If
        End Try
    End Sub

    Private Sub adxOutlookEvents_ItemSend(sender As Object, e As AddinExpress.MSO.ADXOlItemSendEventArgs) Handles adxOutlookEvents.ItemSend
        If OutlookItemEvents IsNot Nothing Then
            OutlookItemEvents.RemoveConnection()
        End If
    End Sub
End Class
Posted 14 Jan, 2015 07:25:27 Top
Andrei Smolin


Add-in Express team


Posts: 18844
Joined: 2006-05-11
Hello Johnny,

Are testing this in Outlook 2013? If so, you need to switch to using ADXRibbonContextMenu because Outlook 2013 doesn't support commandbars (and commandbar-based context menus in particular).


Andrei Smolin
Add-in Express Team Leader
Posted 14 Jan, 2015 09:02:11 Top
Johnnyxp64




Posts: 87
Joined: 2011-05-13
hi,

no i work with oulook 2010 x64, but i will need to have it also in 2013, any plans for the future?
Posted 14 Jan, 2015 09:09:25 Top
Johnnyxp64




Posts: 87
Joined: 2011-05-13
i dont how, i played with the ribbon context just to see it, its not what i need, but the context menu now appears again! :/ ?????

i really dont get it
Posted 14 Jan, 2015 13:48:08 Top
Andrei Smolin


Add-in Express team


Posts: 18844
Joined: 2006-05-11
Such things do happen sometimes ))


Andrei Smolin
Add-in Express Team Leader
Posted 15 Jan, 2015 05:48:18 Top