Article ID: 181899 - Last Review: January 27, 2005 - Revision: 3.4 Multiple e-mail attachments cause error with MSMAPI OCX control that is included in Visual FoxProThis article was previously published under Q181899 On This PageSYMPTOMS
When you attach multiple file attachments by using the MSMAPI32 OCX and you call
the Send method, you receive the following error message:
OLE IDispatch exception code 0 from MAPIMessages: Unspecified Failure
has occurred.
CAUSE
The AttachmentPosition property of the MAPIMessage control is not being
incremented with each attachment. The AttachmentPosition property indicates
the position of the attachment within the message. If two attachments
occupy the same position, an error occurs when the MAPIMessage's Send
method is called.
RESOLUTION
Change the AttachmentPosition for each attachment. In the code sample
below, change the following section:
STATUS
This behavior is by design. MORE INFORMATION
Note This code works with version 6.00.8023 of the Msmapi32.ocx control.
If an earlier version of this control is installed, an error occurs when
setting the LogonUI property. The Msmapi.ocx version 1.0.2815 ships with
Visual FoxPro version 5.0. This code runs under Visual FoxPro 5.0; however,
the later version of the MSMAPI32 control must be installed and registered.
The AttachmentPosition property determines the character position of an attachment within a message. This value can be programmatically set to any position within the message body. However, since the number of attachments may be unknown, it would be easiest to increment the AttachmentPosition property one character for each attachment. Steps to reproduce the behavior
REFERENCES
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
136638
(http://support.microsoft.com/kb/136638/
)
How to send e-mail programmatically by using MSMAPI OLE control
COMCTL1.HLP Help; Topic: "AttachmentPosition Property"
APPLIES TO
| Article Translations
|
Back to the top
