Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #6978

Re: win32ole outlook run macro

Newsgroups comp.lang.ruby
Date 2014-05-26 11:43 -0700
References <1ec3102b-b184-43dc-977a-1b43465a9f3a@f30g2000yqa.googlegroups.com>
Message-ID <fcd34dc8-8557-4b9f-9a04-ae55fc3395d7@googlegroups.com> (permalink)
Subject Re: win32ole outlook run macro
From u.gotzes@gmail.com

Show all headers | View raw


On Monday, March 28, 2011 11:18:07 AM UTC+2, zak wrote:
> Hi,
> 
> with ruby and win32ole it is possible to call a user-defined macro in
> excel:
> 
> excel = WIN32OLE.new('Excel.Application')
> excel.run('macroname')
> 
> how about outlook?
> 
> outlook = WIN32OLE.new('Outlook.Application')
> outlook.run('macroname')
> 
> is not working.
> 
> Thanks!

Mully's hint worked well...until I switch to Outlook 2010 or 2013. With ruby 1.9.3 I get a "NoMethodError: unknown property or method: `Hallo' HRESULT error code:0x80020006"

My ruby-script calls Hallo:
require 'win32ole'
outlook=WIN32OLE.connect('Outlook.Application')
outlook.Hallo

...and the Hallo-macro in Projekt1/Microsoft Outlook Objekte/ThisOutlookSession is implemented as:
Sub Hallo()
    MsgBox "Hallo"
End Sub

As far as I know Macros are activated. Any ideas how to fix this?

Thanks,

Uwe



Back to comp.lang.ruby | Previous | Next | Find similar


Thread

Re: win32ole outlook run macro u.gotzes@gmail.com - 2014-05-26 11:43 -0700

csiph-web