A
abc
Hi,
We are using an Access application with a mail function. We create a new
mail from within the Access application, then manually add an attachment
and send the mail to an external recipient. When the mail is received, the
name of the attachment has changed, i.e. attachment21 (with no extension).
The contents of the attachment cannot be read by any program, as far as I
know.
If we create the same mail from within Outlook and add the same attachment,
everything works as expected.
We are using Outlook 98 (8.5.5104.6), Access 97 (SR-2) and Exchange 5.5
(Build 2650.24: Service pack 3)
Any ideas of how to isolate this problem are appreciated.
This is the code we are using in the Access application:
Sub SendMessage(DisplayMsg As Boolean, strRecipient As String, Optional
varDisplay As Variant)
On Error GoTo Err_SendMessage
Dim objOutlook As outlook.Application
Dim objOutlookMsg As outlook.MailItem
Dim objOutlookRecip As outlook.Recipient
Dim objOutlookAttach As outlook.Attachment
Dim objOutlookContact As outlook.ContactItem
Dim objFolder As Object
Dim nsOutlook As outlook.NameSpace
Dim objAddress As outlook.AddressList
Dim objEntry As outlook.AddressEntry
Dim i As Integer
Set objOutlook = CreateObject("Outlook.Application")
Set nsOutlook = objOutlook.GetNamespace("MAPI")
nsOutlook.Logon
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
If IsMissing(varDisplay) = True Then
Set objOutlookRecip = .Recipients.Add(strRecipient)
Else
Set objOutlookRecip = .Recipients.Add(varDisplay)
End If
objOutlookRecip.type = olTo
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
If DisplayMsg = True Then
.Display
Else
.Send
End If
End With
Set objOutlook = Nothing
Exit_SendMessage:
Exit Sub
Err_SendMessage:
MsgBox Err.Description, vbExclamation, "Send message"
Resume Exit_SendMessage
End Sub
We are using an Access application with a mail function. We create a new
mail from within the Access application, then manually add an attachment
and send the mail to an external recipient. When the mail is received, the
name of the attachment has changed, i.e. attachment21 (with no extension).
The contents of the attachment cannot be read by any program, as far as I
know.
If we create the same mail from within Outlook and add the same attachment,
everything works as expected.
We are using Outlook 98 (8.5.5104.6), Access 97 (SR-2) and Exchange 5.5
(Build 2650.24: Service pack 3)
Any ideas of how to isolate this problem are appreciated.
This is the code we are using in the Access application:
Sub SendMessage(DisplayMsg As Boolean, strRecipient As String, Optional
varDisplay As Variant)
On Error GoTo Err_SendMessage
Dim objOutlook As outlook.Application
Dim objOutlookMsg As outlook.MailItem
Dim objOutlookRecip As outlook.Recipient
Dim objOutlookAttach As outlook.Attachment
Dim objOutlookContact As outlook.ContactItem
Dim objFolder As Object
Dim nsOutlook As outlook.NameSpace
Dim objAddress As outlook.AddressList
Dim objEntry As outlook.AddressEntry
Dim i As Integer
Set objOutlook = CreateObject("Outlook.Application")
Set nsOutlook = objOutlook.GetNamespace("MAPI")
nsOutlook.Logon
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
If IsMissing(varDisplay) = True Then
Set objOutlookRecip = .Recipients.Add(strRecipient)
Else
Set objOutlookRecip = .Recipients.Add(varDisplay)
End If
objOutlookRecip.type = olTo
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
If DisplayMsg = True Then
.Display
Else
.Send
End If
End With
Set objOutlook = Nothing
Exit_SendMessage:
Exit Sub
Err_SendMessage:
MsgBox Err.Description, vbExclamation, "Send message"
Resume Exit_SendMessage
End Sub