First -  I want to give credit to Jeff Evans, who had a file posted named "idx.txt".  This file had a lot of the following information, but it also had some information that I couldn't reconcile with the files I had.  I believe that there were different versions of the files used by Outlook Express.  He had the following e-mail addresses listed:

evansj@triceris.com or evansj@shaw.wave.ca

Then I want to describe what worked for me.

Open the IDX file for binary access and read the header.  The length of the header would be 64 bytes.  Check the fileid and it should be "JMF9".  Then check the size of the file against what the variable "thisfilesize" says it should be.

After that you would have the index items. Here you could find the file pointer and determine where in the file you are located (this would be the SEEK function). If not, you must keep count of the number of bytes that you are reading.  Read the IDXrecord and then read the size of each string, read a dummy integer, set the string to that many "0" characters, then read the string from the file.  You don't have to read a dummy integer if you are reading the size of the string as a long, but beware that sometimes the number that comes back to you is huge, well over the length to which you can set a string.
Do this for the Subject, the to: address (sendtoname) and the From: address (sendername).

Then you have to round out the read since the index items must fall on a 4byte boundary.  If you have previously used the SEEK function, then you can add to the obtained value the "howlongisit" variable, then subtract where you are now (again, using the SEEK function).  Now just read in that many bytes and throw them away.

Now that you have the "messageindexfile" and the "messagesize", you can  read the MBX, go to the location specified by the "messageindexfile" and read "messagesize" amount of bytes.  If the "messagetextsize" is different, then you may have an attachment.  Just display the text.

Now you can repeat.

Barry Eggers
bceggers@usa.net

Disclaimer - This info worked for me, but there is no guarantee that it is accurate for any other version of OUTLOOK EXPRESS.  As you can tell by checking the info listed below, it is not complete.  Use it at your own risk.




Private Type idxheader
    fileid  As String * 4   	'1-4	4 bytes	File ID (the ASCII string "JMF9")
    subid As String * 4     	'5-8	4 bytes	Sub-ID (the hex value 0x04000100) possibly 2 integers for version number 4.1
    numitems As Long    	'9-12	4 bytes	Number of items in the index file (number of e-mail messages)
    thisfilesize As Long    	'13-16	4 bytes	File size in bytes
    other1 As Long  		'17-20	4 bytes	? (seems to contain the hex value 0x01000000)
    filemsgindexinfile As Long  '21-24	4 bytes	? (seems to contain the hex value 0x10000100)
    other2 As String * 40    	'25-64	40 bytes   String composed of 0x00's - buffer to make the header 64 bytes
End Type
Private Type idxrecord
    other0 As String * 16	'0-15	16 bytes seems to be a dummy area. could be the front or back of each index item
    flags As Long		'16-19	2 bytes used for marking read, delete, unread, etc. 2 byte for filler
    other1a As Long		'20-23  not sure of these yet
    msgnumber As Long		'24-27	4 bytes cause each msg gets a unique number
    other1c As Long		'28-31	not sure of these yet
    howlongisit As Long		'32-35	4 bytes length of the index item in this file
    msgindexinfile As Long	'36-39	4 bytes where in the mbx file this message starts
    messagesize As Long		'40-43	4 bytes how long is the message in the mbx file
    other3 As string * 4	'44-47	not sure of these yet seems to be an offset or a length
    other4 As String * 162	'48-221	not sure of these yet
    messagegotdate As Date	'222-229 win32 filetime structure
    messagesentdate As Date	'230-237 win32 filetime structure
    other5 As Integer		'238-239 filler to make it divisible by 4
End Type
'got to read the rest programmatically
Dim subjectsize As Integer	'4 bytes but only read 2 and throw 2 away
Dim subject As String		'size read in previous field
Dim sendtoaddresssize As Integer'4 bytes but only read 2 and throw 2 away
Dim sendtoaddress As String	'size read in previous field
Dim sendernamesize As Integer	'4 bytes but only read 2 and throw 2 away
Dim sendername As String	'size read in previous field
'you will need to make the record evenly divisible by 4
'read (startofrecord (i.e., seek at the beginning) + howlongisit) - hereinfile(i.e., seek at this place)
'and throw it away

Private Type mbxheader
    fileid As String * 4	'4 bytes JMF6
    subid As String * 4		'4 bytes could be 2 integers to read version number
    numofmessages As Long	'4 byte binary number - number of messages in the file,including messages marked for deletion.
    lastusedmessage As Long	'4 byte binary number - last used message number.
    thisfilesize As Long	'4 byte binary number - size of this file in bytes.
    other1 As String * 1	'1 byte hex string x'01' - ?
    filler As String * 63	'63 byte hex string, all x'00' - ?MBX Message
End Type
Private Type mbxrecord
    messageid As String * 4 '4 byte hex string &H007F007F - start of message id
    messagenumber As Long   '4 byte binary number - message number
    messagesize As Long     '4 byte binary number - total size of the message including the message header, message text and any optional padding field
    msgtextsize As Long     '4 byte binary number - size of the following message text
End Type
Dim msgtext As String       'character field, size specified in previous field
'This includes the e-mail headers (e.g. From:, To:, etc.), and any encoded attachments.
'you will need to make the record evenly divisible by 4 - see messagesize in mbxrecord
