How can I read long strings from e-mail.

Hi, I try to read subject from e-mail using MAPI. Subject := MAPIMessages.MsgSubject; If subject has length more than 250 characters I receive message that string to long and process stops. How can I reed such long strings or skip such mails. Valentin Gvozdev BMI Inc.

Generally you cannot access any data which exceeds the navision limit of 250 Bytes. This applies for MsgSubject as well as for MsgBody. I usually solved that problem by calling a self-made Delphi program which processes the mails and returns max. 250 byte blocks to Navision. Marcus Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch

Valentin, Try reading the subject line into a variable of type Binary (which can hold up to 2000 bytes), then loop through this var as if it’s an array, FORMATting each byte into text variables. John