IronRuby for Office AddIns

Hi,

I’d like to write an Outlook(2003 & 2010)-AddIn in Ruby (IronRuby), but
I’m not pretty sure, whether this is possible.
The AddIn should bring up a new icon in Outlooks’ CommandBar and should
read contact items.

I just found some examples, where they put Ruby-Code into a C#-Wrapper
what is not what I want.

The main thing I want to avoid (to be honest) is that I don’t want to
have to buy Visual Studio for a couple of hundreds (thousands?) of
dollars.

I am new to the whole .NET-World and I’m not much into the concept by
now.

Can you give me a hint to point me in the right direction?

Thanks,

Josch

You can download Visual C# Express for free. There is also the
MonoDevelop IDE which is free. Beside that you can use any text editor
together with the ironruby and c# compiler to work in any way you want
:slight_smile:

I am not certain how the Office addin’s work but usually that kind of
thing works with a (.net) dll that exposes some interface
implementation. I’d advice you to look into what kind of interface
Office has, and wether you can do this by compiling a ruby file to a
dll, or making a small c# wrapper which invokes the ruby code in a
separate file or embedded resource.

I hope I gave you some terms to google :slight_smile:

Cheers,
Tinco

Jascha,

You’re need to write a small host for IronRuby in a static .NET
language, as
the Office add-in API most likely requires an actual assembly with
actual
CLR types to be loaded. However, with a minimal shim to host IronRuby in
an
office add-in, you can then write the actual logic of your add-in in
IronRuby. This is the only way IronRuby can run; ir.exe is the IronRuby
runner for cmd.exe, irw.exe is the Windows runner, and
Microsoft.Scripting.Silverlight.dll is the runner for Silverlight. If
there
is a shim that isn’t part of IronRuby itself, you can use the very
simple
Microsoft.Scripting.Hosting APIs directly to run IronRuby in a custom
way.

However, you also want to develop add-ins without purchasing VSTO (VS
Tools
for Office). In that case, would you be able to get away with writing a
program external to Office that controlled it? If so, you can either use
the
Office interop assemblies (
Faster MS Excel Reading using Office Interop Assemblies - CodeProject) or use
the
Win32OLE module in IronRuby to automate Office; this option also avoids
the
static-.NET shim.

~Jimmy