The method returns the number of characters of decoded text.
A return value of zero indicates no text has been decoded. If the
method fails, it will return -1 and the LastError
property can be used to determine the cause of the failure. In
most cases where the method fails, it is because an invalid character
set or encoding type has been specified.
This method provides a means to decode text that was previously
encoded using either base64 or quoted-printable encoding. In most
cases, it is not necessary to use this method because the message
parser will detect which character set and encoding was used, then
automatically decode the message text if necessary.
The value of the CharacterSet parameter does not
affect the resulting output text, it is only used when decoding the
input text. The previous contents of the MessageText string
will be replaced by the decoded text, and the output string will
always be Unicode.
If the CharacterSet parameter is specified as
mimeCharsetUTF16, the encoding type must be
mimeEncodingBase64. Other encoding methods are not supported
for Unicode strings and will cause the method to fail. In most
cases, it is preferable to always use mimeEncodingBase64
as the encoding method, with quoted-printable encoding only used for
legacy support. If an unsupported encoding type is specified, this
method will return -1 and the output text string will be empty. This
method cannot be used to decode uuencoded text.
If you are developing your application using Visual Basic 6.0,
the IDE does not provide complete support for Unicode. The decoded
text may appear to be corrupted when examining it in the debugger. This is because the IDE will attempt
to convert the string to ANSI using the system default code page. To
display Unicode text correctly, you must use controls which are Unicode
aware, such as the Microsoft InkEdit control.