FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Help with Outlook mail object detection
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Help with Outlook mail object detection
Posted: Mon Sep 26, 2011 06:41 PM
I need to get the class of an item in Outlook so I know if it is a valid mail item.
I can't get the class property to work.
Can someone please help me determine what kind if items they are?

[code]
function mytest()
local oOutlook, oExp, oItem, nClass, tReceived
oOutlook := TOleAuto():New( "Outlook.Application" )
oExp := oOutlook:ActiveExplorer
oItem := myOlExp:Selection:Item(1)
// This is supposed to return the class of the item object.
// if oItem:Class = 42 then it should be an email object but it returns another object.
nClass := oItem:Class
tracelog( nClass )
// If the current item is a regular email then the following line works.
// If the current item is an undeliverable message or something other than mail thenthe following line fails
tReceived := oItem:ReceivedTime
return nil
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Help with Outlook mail object detection
Posted: Thu Oct 06, 2011 06:55 PM
Ok it looks like Fivewin is stripping :Class from the assignment.

With #INCLUDE "FIVEWIN.CH" the only change in the sample programs below.
nClass := oItem:Class
turns into
nClass := oItem
in the .ppo

Without #INCLUDE "FIVEWIN.CH"
nClass := oItem:Class
stays that way and works correctly.

This code does not work. Check the .ppo and you will see
Code (fw): Select all Collapse
#INCLUDE "FIVEWIN.CH"
function mytest()
local oOutlook, oExp, oItem, nClass, tReceived
  oOutlook := TOleAuto():New( "Outlook.Application" )
  oExp := oOutlook:ActiveExplorer
  oItem := oExp:Selection:Item(1)
  // oItem:Class is supposed to return the class of the item object.
  // if oItem:Class = 42 then it should be an
  // email object but it returns another object.
  nClass := oItem:Class
  tracelog( nClass )
return nil


This code works.
Code (fw): Select all Collapse
function mytest()
local oOutlook, oExp, oItem, nClass, tReceived
  oOutlook := TOleAuto():New( "Outlook.Application" )
  oExp := oOutlook:ActiveExplorer
  oItem := oExp:Selection:Item(1)
  // oItem:Class is supposed to return the class of the item object.
  // if oItem:Class = 42 then it should be an
  // email object but it returns another object.
  nClass := oItem:Class
  tracelog( nClass )
return nil

Continue the discussion