Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFPCOM and Outlook
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00533278
Message ID:
00533422
Views:
11
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform