[Ironruby-core] IronRuby for Office AddIns

Jimmy Schementi jimmy at schementi.com
Fri Dec 3 13:05:19 EST 2010


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 (
http://www.codeproject.com/KB/office/fasterexcelaccesstoc.aspx) or use the
Win32OLE module in IronRuby to automate Office; this option also avoids the
static-.NET shim.


On Wed, Dec 1, 2010 at 8:56 PM, Tinco Andringa <mail at tinco.nl> wrote:

> 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
> :)
> 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 :)
> Cheers,
> Tinco
> On Wed, Dec 1, 2010 at 13:37, Jascha Luelsdorf <lists at ruby-forum.com>
> wrote:
> > 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
> >
> > --
> > Posted via http://www.ruby-forum.com/.
> > _______________________________________________
> > Ironruby-core mailing list
> > Ironruby-core at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/ironruby-core
> >
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20101203/77c9f438/attachment.html>

More information about the Ironruby-core mailing list