Page 1 of 1

Outlook oMail:ReceivedTime does not work in olFolderInBox 6

PostPosted: Wed Jun 09, 2010 12:09 pm
by MarcoBoschi
Hi to all,
What other properties should I use to get the date and time?

#DEFINE olFolderInBox 6
#include "fivewin.ch"
FUNCTION MAIN()

LOCAL oOutlook := TOleAuto():New( "Outlook.Application" )
LOCAL oNameSpace := oOutlook:getnamespace('MAPI')
LOCAL oFolder := oNameSpace:GetDefaultFolder( olFolderInBox )
LOCAL nItems
LOCAL oMail
LOCAL iMsg

nItems := oFolder:Items:Count

FOR iMsg := 1 TO nItems

oMail := oFolder:Items[ iMsg ]

? oMail:Subject
// ? omail:SentOn
? oMail:CreationTime
? oMail:ReceivedTime // does not work


NEXT iMsg

RETURN NIL

Re: Outlook oMail:ReceivedTime does not work in olFolderInBox 6

PostPosted: Fri Jun 11, 2010 1:14 pm
by MarcoBoschi
Please can someone try and tell me if this program crashes at the line

? oMail:ReceivedTime

Thanks

marco

Re: Outlook oMail:ReceivedTime does not work in olFolderInBox 6

PostPosted: Sat Jun 12, 2010 12:54 am
by Colin Haig
Marco

The following code works for me -

Code: Select all  Expand view

for each oItem In oCMSFolder:Items
   nItem++
   dMail    := oItem:ReceivedTime
   cSender  := oItem:sendername
   cSubject := oItem:subject
   cBody    := oItem:body
   for each oAttach In oItem:Attachments
      cAttach := oAttach:filename
      aadd(aAttach,str(nItem,2) + cAttach)
   next
   aadd(aData,str(nItem,2) + dtoc(dMail) + (left(alltrim(cSender)  + space(30),30)) + (left(alltrim(cSubject)  + space(30),30)) + cBody)
next
SysRefresh()
 


cheers

Colin

Re: Outlook oMail:ReceivedTime does not work in olFolderInBox 6

PostPosted: Mon Jun 14, 2010 8:12 am
by MarcoBoschi
Probably is a "release" problem

I use Microsoft Outlook 2000 (9.0.0.2814)

I will try on a recent versione

Thanks

marco