Win32ole outlook run macro

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!

zak wrote in post #989572:

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!

If your Outlook macro is in the ThisOutlookSession module, then try
calling your macro as a method of the Outlook Application object:

outlook = WIN32OLE.new(‘Outlook.Application’)
outlook.macroname()

David

Following along these lines, is there any reference for the OLE API for
Office products or OLE in general? I’ve always wanted to work with the
win32ole gem, but I don’t know where to look on MSDN to know how to even
play with those APIs.

-Nick K.

Nick K. wrote in post #989800:

Following along these lines, is there any reference for the OLE API for
Office products or OLE in general? I’ve always wanted to work with the
win32ole gem, but I don’t know where to look on MSDN to know how to even
play with those APIs.

-Nick K.

You’ll also find many articles on win32ole automation (Excel, Word,
Outlook, etc.) here:

http://rubyonwindows.blogspot.com

David

On Tue, Mar 29, 2011 at 4:26 PM, Nick K. [email protected] wrote:

Following along these lines, is there any reference for the OLE API for
Office products or OLE in general? I’ve always wanted to work with the
win32ole gem, but I don’t know where to look on MSDN to know how to even
play with those APIs.

Try http://support.microsoft.com/kb/q222101/

It hasn’t been updated for Offices 2007 and 2010, but it’s general
enough to be helpful with those versions, too.


Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.