Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for New E-Mail using MAPI/Outlook 98
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00115948
Message ID:
00115996
Views:
11
Check out the demo in the KB article cited in my first reply. Note the following line:

objMsgFilter.Unread = .T. && Filter for unread messages


>Ken/David,
>So, I guess it's up to the programmer to
>keep track of whether there is an unread, aka
>new, message in the inbox? I wonder if messages
>have a "read" property? How must Outlook do it?
>
>
>
>>Marty,
>>
>>Here's some sample MAPI code:
>>
activate window "debug output"
>>
>>* simple test email program using MAPI
>>
>>oleMAPISession = createobject( "MSMAPI.MAPISession.1" )
>>
>>* Signon to mail
>>with oleMAPISession
>>   .UserName = "Test"
>>   .Password = ""
>>   .Signon()
>>   * Check the SignOn status
>>   if ( .SessionID > 0 )
>>      oleMAPIMessages = createobject( "MSMAPI.MAPIMessages.1" )
>>      * tell the message the SessionID
>>      oleMAPIMessages.SessionID = .SessionID
>>      debugout "Successful mail log on"
>>   else
>>      debugout "Mail login failed"
>>      return
>>   endif
>>endwith
>>
>>* Send an email
>>
>>with oleMAPIMessages
>>   .Compose()
>>
>>* Set the Recipient name and resolve
>>   .RecipDisplayName = "DavidFrankenbach@worldnet.att.net"
>>   .RecipType = 1
>>   .ResolveName()
>>
>>   .MsgSubject = "This is the Subject"
>>   .MsgNoteText = "This is the email text"
>>
>>   .Send( .f. )
>>endwith
>>
>>* Read the InBox
>>
>>with oleMAPIMessages
>>   .Fetch()
>>   for i = 0 to .MsgCount-1
>>      .MsgIndex = i
>>      debugout .MsgSubject
>>   endfor
>>endwith
>>
>>* Signoff
>>
>>oleMAPISession.Signoff()
>>
>>>I remember recently reading a magazine article where the developer was writing an app to give a CEO the sort of graphical "You have new mail" thing that Tom Cruise got in Mission Improbable or Sandra Bullock in Speed. Does anyone know where I can find that article? Or, even better, what would be the smoothest way to just jump into MAPI, check for new mail, then jump out? I'll name the EXE after the first guy who shows me how/points me to the article.
kenweber
GCom2 Solutions
Microsoft Certified Professional

Previous
Reply
Map
View

Click here to load this message in the networking platform