Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jan 2001
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Attachment error from MAPI

    I'm using an Outlook 2000 MAPI.Session object from Access 97 to create a message with an attached Excel 97 spreadsheet.

    Set oSession = CreateObject("MAPI.Session")
    .
    .
    .
    'add the attachment objects
    Set oAttachment = .Attachments.Add
    With oAttachment
    .Type = 1 'file attachment; other numbers correspond to other attachment types
    .Name = FileToSendPathName 'display name of attachment
    End With
    oAttachment.ReadFromFile FileToSendPathName 'read file into the message
    End If

    The message and attachment are received as Plain Text, even though the sending Outlook send option is RTF.

    When an Outlook 2000 user double clicks on the attachment to read it, it is copied to the Temporary Internet FileOLK folder as att<nn>.tmp where <nn> is two numbers, and the user is given the error message "The file <path>at.. does not have a program associated with it." since .tmp isn't associated with Excel.

    What can I do in the MAPI session to solve this ?

  2. #2
    j1greene
    Guest

    Re: Attachment error from MAPI

    I am having a similar problem, however it is with a different type of attachment. My company uses Seagate Info, to generate reports. Some of our users do not have the full client components for Info installed, they just use the stand alone Info Analyzer as a viewer.

    These users cannot open an RPT attachment (Native Crystal Reports or Seagate Info file) from within Microsoft Outlook 2000 since we upgraded to Info 7.5.

    We were saving the RPT files to an Exchange Public Folder, but we have also tried emailing the reports to these users. If they double-click the file and choose open, it fails with:

    "Can't open this item. The file, 'C:WINNTProfiles{username}Temporary Internet FIlesOLK60{filename.RPT} does not have a program associated with it for this action. To create an association, double-click My Computer on your desktop. On the View menu, click Options, then click File Types.'

    I have compared the file association for view and open on some of these machines with machines that work, and I cannot see any differences.

    Since they can choose save, and open the file from their local hard drive by double-clicking it, it seems that the file association should be correct.

    Previously they were able to open the

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Attachment error from MAPI

    Okay, I've never seen MAPI code before, so this is a wild guess:

    <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q198/8/97.ASP>DOC: Incorrect Attachment Name/Icon For Word/Excel Attachments</A>

    Set objAttach = .Attachments.Add ' add the attachment
    With objAttach
    .Type = CdoFileData
    .Position = 0 ' render at first character of message
    .Name = "MyExcelFile.xls"
    .Source "c:MyExcelFile.xls"
    End With
    .Update ' update message to save attachment in MAPI system

  4. #4
    New Lounger
    Join Date
    Jan 2001
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Attachment error from MAPI

    Adding the .Source=<filename> line fixed the problem.

    Thanks!!

    'we got the attachment; set it's properties and read it from the file
    With oAttachment
    .Type = 1 'file attachment; other numbers correspond to other attachment types
    .Source = ToSendFileName ' allows opening by double click with xls file type in Outlook
    .Name = ToSendFileName

    End With

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •