Outlook oMail:ReceivedTime does not work in olFolderInBox 6

Outlook oMail:ReceivedTime does not work in olFolderInBox 6

Postby MarcoBoschi » Wed Jun 09, 2010 12:09 pm

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
User avatar
MarcoBoschi
 
Posts: 1025
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

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

Postby MarcoBoschi » Fri Jun 11, 2010 1:14 pm

Please can someone try and tell me if this program crashes at the line

? oMail:ReceivedTime

Thanks

marco
User avatar
MarcoBoschi
 
Posts: 1025
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

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

Postby Colin Haig » Sat Jun 12, 2010 12:54 am

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
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

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

Postby MarcoBoschi » Mon Jun 14, 2010 8:12 am

Probably is a "release" problem

I use Microsoft Outlook 2000 (9.0.0.2814)

I will try on a recent versione

Thanks

marco
User avatar
MarcoBoschi
 
Posts: 1025
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 34 guests