Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anybody got a clue on this?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Anybody got a clue on this?
Divers
Thread ID:
00534668
Message ID:
00534668
Vues:
52
Okay, here is a working example of some generic code regarding the problem, see below for the details:
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
I'm using Windows 2000 pro and Outlook 2000, now SR1a.
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. I got a suggestion to look up the error on google, and I followed the suggestions on just about every link that was returned, including installing the Office SR1a SP. I just can't get it to work, totally lost here.
Thanks a lot, folks
John
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform