Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to KEEP reading events?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
How to KEEP reading events?
Divers
Thread ID:
00858174
Message ID:
00858174
Vues:
75
I have a little program that I wrote to emulate (for Outlook 2002) the way that Outlook 2003 pops up a message window when a new email arrives.

Everything works, except that after the first message is displayed, the program ends ... like it thinks it's done reading events. The only clear events I have is in the IconDblClickEvent of the Systray object.

Any ideas? Do I need to put a do ... while loop around the read events command that says something like: do while type(loSysTray.TipText)=="C"? If so, I'm still curious as to why READ EVENTS stops "reading". Thanks for any advice!

Here is the code:
LOCAL loSysTray as Object, loObj as Object, loEvents as Object

* MySysTray is class defined as systray of systray.vcx
loSysTray = CREATEOBJECT("mySysTray")   

IF !TYPE("loSysTray.TipText") == "U"
   loObj = CREATEOBJECT("Outlook.Application")
   loEvents = CREATEOBJECT("OAEvents")

   EVENTHANDLER(loObj,loEvents)

   READ events

   RELEASE loSysTray
   RELEASE oEvents
ENDIF 

RETURN

DEFINE CLASS OAEvents AS session OLEPUBLIC

   IMPLEMENTS ApplicationEvents_10 IN "c:\progra~1\micros~2\office10\msoutl.olb"

   PROCEDURE ApplicationEvents_10_NewMail() AS VOID
   * add user code here
      oApp = CREATEOBJECT("Outlook.Application")
      IF oApp.Explorers.Count > 0
         oSafeItem = CREATEOBJECT("Redemption.SafeMailItem")
         oFolder = oApp.explorers.item(1).CurrentFolder
         oSafeItem.Item = oFolder.Items(1)
         DO FORM c:\foxtemp\newmail WITH oSafeItem.SenderName, oSafeItem.Subject
         RELEASE oApp
         RELEASE oSafeItem
         RELEASE oFolder
      ENDIF 
   ENDPROC
ENDDEFINE
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform