OLE and Outlook

  • Thread starter Thread starter DRIESSEN Michel
  • Start date Start date
D

DRIESSEN Michel

Hello,

I have a question concerning linking a software with Outlook through OLE.

I tried to run a macro, defined in Outlook, but it doesn't seem to be that
easy.

If I use Word through OLE, it is very easy to start a macro from my software
in Word.

I use this code :

hWordOle := CreateOleObject("Word.Application")
OleSetProperty(hWordOle,"Visible",.T.)
OleInvoke(hWordOle ,"Run" ,"JUD_OPSL")

"JUD_OPSL" is the name of the macro which has to be run in Word.

I tried to use the same kind of code for Outlook :

hOutlOle := CreateOleObject("Outlook.Application")
OleSetProperty(hOutlOle,"Visible",.T.)
OleInvoke(hOutlOle ,"Run" ,"OUTL_MACRO")

The Outlook object is being created (I can see the icon in my system tray).
But why is the macro "OUTL_MACRO" NOT being excecuted ?

How can a macro being run from another software ?

Thanks a lot in advance for any help.

Regards,

Michel D.
Genk (Belgium)
 
The macro has to be a Public procedure in the ThisOutlookSession module. I
don't believe you can call a procedure in other modules from an external app.
 
Back
Top