[Stackoverflow] [Progress OpenEdge ABL] How to check if an email is a draft, sent or received? (Openedge 11)

Status
Not open for further replies.
C

CephDigital

Guest
I'm trying to create a way to check whether a given email (either from Outlook itself or an MSG file) is a sent, received or a draft email. I got the bit to compare if it was sent or received somewhere else and that works fine but it's the part that determines if it's a draft or not that is the issue. Below is what I have currently.

Code:
        L-EMAIL = Aspose.Email.Mapi.MapiMessage:FromFile(P-FILENAME).
        L-EMAIL-FLAG = Integer(L-EMAIL:Properties[Aspose.Email.Mapi.MapiPropertyTag:PR_MESSAGE_FLAGS]:ToString()).
        IF L-EMAIL-FLAG = 8 THEN
            L-EMAIL-STATUS = "DRAFT".
        ELSE
            IF L-EMAIL:Properties[Aspose.Email.Mapi.MapiPropertyTag:PR_RECEIVED_BY_ENTRYID] = ? THEN
                L-EMAIL-STATUS = "SENT".
            ELSE
                L-EMAIL-STATUS = "RECEIVED".

If there's no attachments to the emails, it works fine since the value of a draft email is always 8 but as soon as you add attachments, it gets all weird with the values so I can't get a range down (I've gotten values like 24 and 242613 while a sent email with an attachment has a value of 49). Anyone know a smarter way of telling if it's a draft or not?

Continue reading...
 
Status
Not open for further replies.
Top