Announcement

Collapse
No announcement yet.

Outlook 2010 AddIn > ContextMenuFolder > GetFolder

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Outlook 2010 AddIn > ContextMenuFolder > GetFolder

    Hi,

    bei einem Outlook 2010 Addin habe ich aktuell ein Problem im Zusammenhang mit im OnAction Fall bei einem ContextMenuFolder-Item.

    Ich füge in das Kontextmenü von Outlook-Ordnern einen neuen Menüpunkt ein.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
        
    .
    .
    .
    
      <contextMenus>    
        <contextMenu idMso="ContextMenuFolder">            
          <menuSeparator id="SeparatorBeforeCreateSnapshot"/>
          <button id="ContextMenu_CreateSnapshot" label="Create Snapshot" onAction="CreateSnapshot" enabled="true" visible="true" getImage="Ribbon_GetImage"/>      
        </contextMenu>
      </contextMenus>
    
    </customUI>
    Nun habe ich das Problem, dass ich z.Z. keine Ahnung habe (googeln bachte mich auch nicht weiter), wie ich im OnAction-Fall den Ordner ermitteln kann, auf dem das Kontextmenü geöffnet wurde.

    Die Callback Funktion...

    Code:
    public void CreateSnapshot(Office.IRibbonControl control)
    {
                MessageBox.Show("Test", "Test", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
    }
    ...funktioniert tadellos, aber wie komme ich an das Folder-Object auf dem rechtsgeklickt wurde?

    P.S:

    Code:
    Globals.ThisAddIn.Application.ActiveExplorer().Selection[1].Parent
    Ist es schon mal nicht, weil sich die Selection z.B. nicht ändert, wenn ich rechts auf einen Ordner klicke, der vorher noch nicht gewählt war (linksgeklickt wurde).
    Zuletzt editiert von dibr; 20.05.2011, 11:25.
Working...
X