Open Method  
 

Open the specified text file and parse the contents.

Syntax

object.Open( FileName )

Parameters

FileName
A string which specifies the name of the file.

Return Value

A value of zero is returned if the method succeeds. Otherwise, a non-zero error code is returned which indicates the cause of the failure.

Remarks

This method opens the specified file, reads the contents into memory and then parses the message. The file must be a text file which uses the standard MIME message structure. It may contain multiple parts, including file attachments and alternative representations of the same message. This function cannot be used to open messages stored in a binary format.

The maximum size of an individual message is 2 GiB (approximately 2 billion characters). This limitation is implemented as a safety check to prevent opening very large files which are unlikely to contain a valid MIME formatted message. Most services impose much lower limits on the maximum size of an individual mail message.

Note: This method can only be used to open and parse messages structured according to the MIME (Multipurpose Internet Mail Extensions) standard, such as plain text .eml or .txt files. It cannot open messages stored in proprietary or binary formats used by certain email clients. For example, it does not support Microsoft Outlook message files such as .msg or mailbox files like .pst and .ost, nor does it support formats used by other clients such as Thunderbird's .msf (mail summary files) or the mbox family (.mbx, .mbox) when stored as binary containers. Attempting to open these file types will result in an error. If you need to work with messages exported from Outlook or other proprietary clients, first save or export them in the standard text format before using this method.

If another message was previously opened or created using the same instance of the control, the internal handle which references the previous message will be closed. If you wish to preserve any changes made to the current message, use the Export method prior to calling this method.

See Also

Close Method, Export Method, Import Method