PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Difference EmailReadFirstHeader  and EmailReadFirst, number of attachments
Difference EmailReadFirstHeader and EmailReadFirst, number of attachments
Iniciado por walter, 05,mar. 2018 11:26 - No hay respuesta
Publicado el 05,marzo 2018 - 11:26
Hi forum,

Based on the example "wd-outlook', I have build an email -in table . In this table I want to show an icon 'paperclip' if there are any attachments to the mail.

The emails are loaded into the table in the local procedure listMails

- EmailReadFirstHeader does not return the number of attachments in the row. The documentation states that the email structure is being used when omitting the email variable. EmailReadFirst does return the number of attachments.

q1. What's the difference between EmailReadFirstHeader and emailReadFirst?
q2. If the difference is speed , how to return the of attachments in EmailReadFirstHeader and EmailReadNextHeader ?


PROCEDURE ListMails(bReadFirst = True)

HourGlass()

Multitask(-1)

dTodaysDate is Date =Today()
dReceiveDate is Date

// Displays the list of OutLook messages
TableDeleteAll(TABLE_Emails)

IF bReadFirst = True THEN
EmailReadFirstHeader(gnSessionId)
END

WHILE Email.Out = False

Multitask(-1)
//Depending on he element that is selected in "When?", add or not the email in the table
TableAddLine(TABLE_Emails, Email.Sender,Email.Subject,Email.ReceiveDate, Email.ID, Email.NbAttach)
EmailReadNextHeader(gnSessionId)
end