win32ole outlook run macro

Discussion in 'Ruby' started by zak, Mar 28, 2011.

  1. zak

    zak Guest


    with ruby and win32ole it is possible to call a user-defined macro in

    excel ='Excel.Application')'macroname')

    how about outlook?

    outlook ='Outlook.Application')'macroname')

    is not working.

    zak, Mar 28, 2011
    1. Advertisements

  2. zak

    David Mullet Guest

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

    outlook ='Outlook.Application')

    David Mullet, Mar 29, 2011
    1. Advertisements

  3. zak

    Nick Klauer Guest

    [Note: parts of this message were removed to make it a legal post.]

    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 Klauer
    Nick Klauer, Mar 29, 2011
  4. Try

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

    Phillip Gawlowski

    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.
    Phillip Gawlowski, Mar 29, 2011
  5. zak

    David Mullet Guest

    Nick Klauer wrote in post #989800:
    You'll also find many articles on win32ole automation (Excel, Word,
    Outlook, etc.) here:

    David Mullet, Mar 30, 2011
  6. zak

    u.gotzes Guest

    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'

    ....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?


    u.gotzes, May 26, 2014
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.