Thread: eMail problem
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jos Vens[_2_] Jos Vens[_2_] is offline
external usenet poster
 
Posts: 134
Default eMail problem

I have 2 questions:

- mail via Outlook Express with compression works but the attachment is not
added
- the reply to option in Outlook (eMail.ReadReceiptRequested = vReplyTo)
gives an error

Can you help me?
Thanks
Jos Vens

here's my code


Function MAIL_Mail() '(vFile As String) 'vFile = Bestandsnaam, zonder
extensie van het bestand

Dim oOutlook ', vMapi

Set oOutlook = CreateObject("Outlook.Application")
'Set vMapi = oOutlook.GetNameSpace("MAPI")

Set eMail = oOutlook.CreateItem(0)

vRecipient = "
vSubject = "MXLibra Punten " & pTransfer & " toegestuurd door " &
sParameters.[gUser]
vBody = "Libra Punten " & pTransfer & " toegestuurd door " &
sParameters.[gUser]
vAttachment = pTransfer & ".gz"
vReplyTo = "

Select Case sParameters.[nMX]
Case 1 'Outlook

eMail.Recipients.Add (vRecipient)
eMail.Subject = vSubject
eMail.Body = vBody
eMail.Attachments.Add (pFTransfer & vAttachment)
' eMail.ReadReceiptRequested = vReplyTo

eMail.Send

' Shell sParameters.[pFileMX], vbMaximizedFocus

Case 2 'Outlook Express with compression

vMail = "mailto:" & vRecipient & "?subject=" & vSubject & "&body="
& vBody & "&attachment=" & pFTransfer & vAttachment
ActiveWorkbook.FollowHyperlink vMail

Case 3 'Outlook Express without compression

Workbooks.Open (pTransfer & vExt), False, True
Windows(vFile & vExt).Visible = False
Workbooks(vFile & vExt).SendMail vRecipient, "Libra Punten " &
vFile & " (" & vVak & ") toegestuurd door " & sParameters.[gUser], True
Workbooks(vFile & vExt).Close SaveChanges:=False

Shell sParameters.[pFileMX], vbMaximizedFocus

End Select

End Function