File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
RetailCoder.VBE/UI/Command
Rubberduck.VBEEditor/VBEHost Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ public override bool CanExecute(object parameter)
32
32
}
33
33
34
34
// Outlook requires test methods to be located in [ThisOutlookSession] class.
35
- return app . ApplicationName != "Outlook" ;
35
+ //return app.ApplicationName != "Outlook";
36
+ return true ;
36
37
}
37
38
38
39
public override void Execute ( object parameter )
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Runtime . InteropServices ;
3
- //using Microsoft.Office.Interop.Outlook;
3
+ using Microsoft . Office . Core ;
4
+ using Microsoft . Office . Interop . Outlook ;
4
5
5
6
namespace Rubberduck . VBEditor . VBEHost
6
7
{
@@ -23,7 +24,18 @@ public override void Run(QualifiedMemberName qualifiedMemberName)
23
24
//taskitem.Subject = "Rubberduck";
24
25
//taskitem.Body = qualifiedMemberName.MemberName;
25
26
26
- throw new NotImplementedException ( ) ;
27
+ try
28
+ {
29
+ var app = Application ;
30
+ var exp = app . ActiveExplorer ( ) ;
31
+ CommandBar cb = exp . CommandBars . Add ( "RubberduckCallbackProxy" , Temporary : true ) ;
32
+ CommandBarControl btn = cb . Controls . Add ( MsoControlType . msoControlButton , 1 ) ;
33
+ btn . OnAction = qualifiedMemberName . ToString ( ) ;
34
+ btn . Execute ( ) ;
35
+ cb . Delete ( ) ;
36
+ }
37
+ catch {
38
+ }
27
39
}
28
40
}
29
41
}
You can’t perform that action at this time.
0 commit comments