Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hooking into Outlook Events
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Hooking into Outlook Events
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01166586
Message ID:
01166586
Views:
49
With my previous version of Outlook, I was able to open the object in my object inspector and use EVENTHANDLER() to bind my own events class to the application.

I now have Office 2003 and I can no longer find the Outlook object in the object browser, nor can I seem to figure out how to bind to its events.

On the MSDN site, there are VB examples of how to bind to Office 2003 events ... so it seems like the functionality is there, but I'm not able to figure out how to implement this in VFP.

BTW, here is what I am specifically trying to accomplish. I do the following:
   TRY 
      loApp = CREATEOBJECT("Outlook.Application")
      loItem = loApp.CreateItem(0)
   CATCH
      RELEASE loApp
      RELEASE loItem
   ENDTRY

*--- If Outlook was properly instantiated
IF VARTYPE(loApp) == 'O' AND VARTYPE(loItem) == 'O'
   TRY 
      loItem.Attachments.Add(cFileName)
      loItem.Subject = oPrt.EmailSubject
      loItem.Display
      llSent = .T.
   CATCH 
      llSent = .F.
   ENDTRY 
ENDIF
This opens a window for the user to type an email and send it. However, I would like to be able to hook into the Send event so that I could log some information about the email in a table.

Thanks for whatever help you can offer!
Next
Reply
Map
View

Click here to load this message in the networking platform