Syntax
MAPISendDocuments(UIParam, DelimChar$, FilePaths$, FileNames$, Reserved)
Remarks
Sends a standard mail message. Calling the function displays a Send Note dialog box, which prompts the user to send a mail message with data file attachments. Attachments can include the active document or all the currently open documents. The function is used primarily for calls from a macro or scripting language, often found in applications such as spreadsheet or word-processing programs.
If the user is not currently logged in, a standard log-in dialog box appears. After the user logs in succesfully, the Send Note dialog box appears.
The user's default messaging options are used as the default dialog box values. The function caller is responsible for deleting temporary files created when using this function.
Argument | Explanation |
UIParam | The parent window handle for the dialog box. A value of 0 (zero) specifies that the Send Note dialog box is application modal. |
DelimChar$ | A string containing the character used to delimit the names in the FilePaths$ and FileNames$ arguments. This character should not be |
FilePaths$ | A string containing the list of full paths (including drive letters) C:\TMP\TEMP1.DOC;C:\TMP\TEMP2.DOC The files specified in this argument are added to the message as file attachments. If this argument contains an empty string (""), the Send Note dialog box is displayed with no attached files. |
FileNames$ | A string containing the list of the original filenames (in 8.3 format) as they should be displayed in the message. When multiple names are specified, the list is formed by concatenating the filenames separated by the character specified in the DelimChar$ argument. For example: MEMO.DOC;EXPENSES.DOC Note that the icon displayed for a file is based on the filename extension supplied in this argument. For example, a filename with an .XLS extension is displayed with a Microsoft Excel icon. Mail also relies on the file extension when opening and saving a file. If an attached file has no extension, append the default extension for your application's document type. |
Reserved | Reserved for future use. This argument must be 0 (zero). |
The following table lists the possible return values of the MAPISendDocuments function and their meanings.
Value | Name | Meaning | |
–12 | MAPI_E_ATTACHMENT_ | One or more files in the FilePaths$ argument could not be located. No mail was sent. | |
–4 | MAPI_E_DISK_FULL | The disk was full. | |
–2 | MAPI_E_FAILURE | One or more unspecified errors occurred while sending the mail. It is not known if the mail was sent. | |
–5 | MAPI_E_INSUFFICIENT_MEMORY | There was insufficient memory | |
–3 | MAPI_E_LOGIN_FAILURE | There was no default log-in, | |
–1 | MAPI_USER_ABORT | The user canceled the process (from the send dialog box). No mail was sent. | |
0 | SUCCESS_SUCCESS | The mail was successfully sent. The caller is responsible for deleting any temporary files referenced in the FilePaths$ argument. |
Example
The following example displays the Send Note dialog box with two attachments.
Sub MAIN result = MAPISendDocuments(0, ";",\ "C:\DOCUMENT\THANKYOU.DOC;C:\WGTPLATE\CONTRACT.DOC" \ "THANKYOU.DOC;CONTRACT.DOC",0) End Sub