Hejsa.
Jeg har lavet et program, der skal sende en fil, vha Mapi. Det virker godt nok - troede jeg. Nu viser det sig, at hvis ikke at brugeren bruger Word Editor, så kommer attachment ikke med. Problemet opstår kun ved Word/Outlook 97 - I 2000 virker det.
Nogen idéer??
sfilename = Pub.FullName
MainForm.Enabled = False
MailIO_Initialize
Dim dummy As String, p As Integer
p = InStrRev(sfilename, "\")
dummy = Pub.TemporaryPath & "\mail_" & Mid(sfilename, p + 1)
CopyFile sfilename, dummy, False
DoEvents
With MAPISession1
.DownLoadMail = False
.SignOn
MAPIMessages1.SessionID = .SessionID
With MAPIMessages1
.Compose
.AddressResolveUI = True
.RecipAddress = Mail.Sendto
.RecipDisplayName = .RecipAddress
.ResolveName
.MsgNoteText = " " & vbNewLine & Mail.Body
.MsgSubject = Mail.Subject
.AttachmentType = 2 ' mapData
.AttachmentPathName = dummy
.AttachmentName = "Bestilling"
.AttachmentPosition = 0
On Local Error Resume Next
.Send True
If Err <> 0 And Err <> 32001 Then
MsgBox "Fejl ved afsendelse af bestilling." & vbNewLine & Err.Description & " - " & Err.Number, vbInformation, "Advarsel"
End If
End With
.SignOff
End With
Kill dummy
Exit Sub
Mvh
CADmageren
Michael Christoffersen
|