Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

PRB: Sending Mail With SendObject Contains an Attachment With an Incorrect File Name or File Type.


Author: Steve Arbaugh

View products that this article applies to.

Summary

This article discusses the cause and solution when calling SendObject in Access using a Lotus Notes mail client, where the file attachment in the resulting Lotus Notes mail Memo created by SendObject has an incorrect file name and file suffix.

↑ Back to the top


Symptoms

When Lotus Notes is�your Mail Client and�you call the SendObject Macro Action or SendObject Visual Basic Method in Microsoft Access�and include an Access�object in the�e-mail to send as an attachment, be it a Form, Report or any other object, then, when the resulting Lotus Notes mail Memo is created, it contains a file�attachment but the�file attachment�is incorrectly named and / or has an incorrect file type suffix.

Specifically�the attachment contained in Lotus Notes mail Memo, contains an attachment item that has a name similar to "XXXX.xls" where XXXX may be any combination of letters and numbers, even though the SendObject call specified to sent the attachment as�in RTF, Snapshot, Text or other file format.

As an example in Visual Basic, your database application makes�a SendObject call like the following:

DoCmd.SendObject acSendReport, "My Report", acFormatRTF, "testme@somewhere.com", , , "Sending A Report", "This is the Access Report"

or

DoCmd.SendObject acSendReport, "My Form", "Snapshot Format (*.snp)", "testme@somewhere.com", , , "Sending A Form", "This is the Access Form"

The resulting Notes mail Memo contains an attachment named "C2B4.xls"

The problem may occur regardless of the Output Format�used in the SendObject call.

↑ Back to the top


Cause

When Access objects are sent as attachments to e-mail items using the SendObject action or SendObject method, Access creates a file that is based on the form or report object's name.��If as an example, you specify that�a�Report called "Monthly Report" is�to be�included�in the mail using a Snapshot format file, Access will always create a file�named "Monthly Report.snp"�for the attachment�with the same name each time SendObject is called.� This is expected behavior.

In a normal situation, during the process where the new mail Memo is created by�Lotus Notes, a copy of the intended file attachment is created in the user's�temp directory; Lotus Notes then attaches that temporary�file to the new mail Memo and then deletes the temporary file�from the temp directory.

If for any reason, the�creation of the Notes mail Memo�fails during this process, the temporary copy of the intended�file attachment is left in the user's�temp directory as an orphaned file.�

If the user then calls SendObject again, with same Report or�Form name specified�(causing Access to�create a file with the same name to use as an attachment ), when�Notes attempts to create the temporary copy of the attachment file in the user's temp directory, the old orphaned file of the same name is found.� So as to not to overwrite the original (now orphaned)�file, a new temporary copy of the attachment file is created, however that temporary file is created with a name in the XXXX.xls format.� That temporary .xls file is then attached to the Lotus Notes mail Memo.

The file internally is the correct .rtf, .snp or other format specified in the SendObject call, it is however improperly named in the Note Memo.

↑ Back to the top


Resolution

The problem can be solved by deleting any orphaned files of the same file type (e.g .snp, .rtf, .txt)�that remain in the user's system temporary directory.

On Windows 98 and Me, the temporary directory is commonly located in the path:

C:\Windows\Temp

On a Windows NT / 2000 / Xp or Server 2003 the temp directory is commonly located in the path:

%System Drive%\Documents and Settings\User Name\Local Settings\Temp

Where %System Drive% is the drive partition on which the operating system is installed, and User Name is the user's log on name.

However, on Windows 2000 and Xp the temp directory is�by default�a hidden directory.�� To view the files located in that directory you may have to open Windows Explorer and from the Tools menu item, select "Folder Options" and on the "View" tab, click "Show Hidden Files and Folders".

Then navigate in Explorer to the temp directory and delete any file that has the same name as the file you are�expecting to be included as an e-mail attachment.

↑ Back to the top


More information

This problem may occur in all versions of Microsoft Access including Access 97, 2000, 2002 (Xp) and Access 2003 when Lotus Notes is the Mail Client.

↑ Back to the top


Properties

COMMUNITY SOLUTIONS CONTENT DISCLAIMER
MICROSOFT CORPORATION AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY, RELIABILITY, OR ACCURACY OF THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN. ALL SUCH INFORMATION AND RELATED GRAPHICS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION AND RELATED GRAPHICS, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, TITLE AND NON-INFRINGEMENT. YOU SPECIFICALLY AGREE THAT IN NO EVENT SHALL MICROSOFT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE, DATA OR PROFITS, ARISING OUT OF OR IN ANY WAY CONNECTED WITH THE USE OF OR INABILITY TO USE THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN, WHETHER BASED ON CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY OR OTHERWISE, EVEN IF MICROSOFT OR ANY OF ITS SUPPLIERS HAS BEEN ADVISED OF THE POSSIBILITY OF DAMAGES.

↑ Back to the top


Community solutions content disclaimer

Microsoft corporation and/or its respective suppliers make no representations about the suitability, reliability, or accuracy of the information and related graphics contained herein. All such information and related graphics are provided "as is" without warranty of any kind. Microsoft and/or its respective suppliers hereby disclaim all warranties and conditions with regard to this information and related graphics, including all implied warranties and conditions of merchantability, fitness for a particular purpose, workmanlike effort, title and non-infringement. You specifically agree that in no event shall Microsoft and/or its suppliers be liable for any direct, indirect, punitive, incidental, special, consequential damages or any damages whatsoever including, without limitation, damages for loss of use, data or profits, arising out of or in any way connected with the use of or inability to use the information and related graphics contained herein, whether based on contract, tort, negligence, strict liability or otherwise, even if Microsoft or any of its suppliers has been advised of the possibility of damages.

↑ Back to the top


Keywords: KB555020, kbhowto, kbpubmvp, kbpubtypecca

↑ Back to the top

Article Info
Article ID : 555020
Revision : 1
Created on : 12/6/2003
Published on : 12/6/2003
Exists online : False
Views : 285