Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFPCOM and Outlook
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00533278
Message ID:
00533422
Vues:
10
Okay, here is a working example of what I was talking about:
PUBLIC goVFPCOM, goOutlook, goLink, goSpace, goInbox

goVFPCOM  = CREATEOBJECT( "VFPCOM.COMUTIL" )
goOutlook = CREATEOBJECT( "Outlook.Application" )
goLink    = CREATEOBJECT( "OutlookApplicationEvents" )
goVFPCOM.BindEvents( goOutlook, goLink )
goSpace = goOutlook.GetNameSpace( 'MAPI' )
goInbox = goSpace.GetDefaultFolder( 6 )  && The default Inbox folder

DEFINE CLASS OutlookApplicationEvents AS custom

  PROCEDURE ItemSend( Item, Cancel )
  * Add user code here
  ENDPROC

  PROCEDURE NewMail
      
    FOR EACH loMsg IN goInbox.Items
      IF loMsg.Unread
        MESSAGEBOX( "FROM:     " + loMsg.SenderName + CHR( 13 ) + ;
                    "SUBJECT:  " + loMsg.Subject, 0, "NEW MAIL" )
      ENDIF
    ENDFOR

  ENDPROC

  PROCEDURE OptionsPagesAdd( Pages )
  * Add user code here
  ENDPROC

  PROCEDURE Quit
    goOutlook = NULL
    goLink    = NULL
    goVFPCOM  = NULL
    goSpace   = NULL
    goInbox   = NULL
  ENDPROC

  PROCEDURE Reminder( Item )
  * Add user code here
  ENDPROC

  PROCEDURE Startup
  * Add user code here
  ENDPROC

ENDDEFINE
The problem with this, is that everytime new mail arrives, the messagebox pops like expected, but after I OK it, another messagebox pops, this one from Outlook. It says Microsoft Outlook in the title, and has one OK button. The message is "The custom form could not be opened. Outlook will use an Outlook form instead." Anybody have any clue what this is all about, and how can I get rid of it. Thanks a lot, folks,
John
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform