• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Office 2007 Mail Gönderim Hatası Hk.

  • Konbuyu başlatan Konbuyu başlatan Ozcan27
  • Başlangıç tarihi Başlangıç tarihi
Katılım
24 Ağustos 2006
Mesajlar
12
Excel Vers. ve Dili
Excel 2003
Dostlar merhaba,

Office 2007 excel ve outlook kullanıyorum. Daha önce Office 2003 te hazırladığım ekli mail gönderim makrosu 2007 de hata veriyor. Aldığım hata tam olarak excel sheetinde bulunan tablonun mail içerisine yansımaması. This page uses frames, but your browser doesn't support them.

Yardımlarınız için şimdiden teşekkürler...

Kullanılan kod:

'Dim OutApp As Outlook.Application
'Dim OutMail As Outlook.MailItem
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = mto
.CC = ""
.BCC = "xxxx"
.Subject = xxxxxxxxxxxxxxxxxxxxxRaporu"
.HTMLBody = "<font face='Verdana' size=2>xxxxxxxxxxxxx.<p>" & _
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxp>" & _
"<p>" & _
"<b></b><p>" & _
"<b>Saygılarımla</b><p>" & _
SheetToHTML(ActiveSheet)
.Display
'.Send 'or use .Display
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
Next
MsgBox "İşlem Tamam"
End Sub
 
SheetToHTML için ayrı bir function var. onuda ekleyeyim.

Public Function SheetToHTML(sh As Worksheet)

Dim TempFile As String
Dim Nwb As Workbook
Dim myshape As Shape
Dim fso As Object
Dim ts As Object
sh.Copy
Set Nwb = ActiveWorkbook
For Each myshape In Nwb.Sheets(1).Shapes
myshape.Delete
Next
TempFile = Environ$("temp") & "/" & _
Format(Now, "dd-mm-yy h-mm-ss") & ".htm"
Nwb.SaveAs TempFile, xlHtml
Nwb.Close False
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)
SheetToHTML = ts.ReadAll
ts.Close
Set ts = Nothing
Set fso = Nothing
Set Nwb = Nothing
Kill TempFile
End Function
 
Geri
Üst