- Katılım
- 18 Ekim 2005
- Mesajlar
- 146
- Excel Vers. ve Dili
- Excel 2007 (12) SP2 Türkçe
Merhaba Arkadaşlar;
Yazdığım dosya bu forumdan öğrendiğim e-mail kodunu koydum. Ve e-mail gönderilecek alanı seçtim,kod şu:
Bu koduda bir düğmeye bağladım. Ãimdi yapmak istediğim bu düğmeye tıkladıktan sonra belirteceğim yoldaki klasörün içine o günkü tarih - no olarak kayıt yapması. 12.11.2005-1;eğer bir tane daha dosya gönderilire 12.11.2005-2 olarak. yardımlarını bekliyorum. Teşekkürler.
Yazdığım dosya bu forumdan öğrendiğim e-mail kodunu koydum. Ve e-mail gönderilecek alanı seçtim,kod şu:
Kod:
Sub EmailSheet()
Dim OutlookApp As Object, OutlookMsg As Object
Dim FSO As Object, BodyText As Object
Dim MyRange As Range, TempFile As String
On Error Resume Next
Set MyRange = ActiveSheet.Range("A1:H30")
If MyRange Is Nothing Then Exit Sub
Set FSO = CreateObject("Scripting.FilesystemObject")
TempFile = "C:\TempHTML.htm"
ActiveWorkbook.PublishObjects.Add _
(4, TempFile, MyRange.Parent.Name, MyRange.Address, 0, "", "").Publish True
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMsg = OutlookApp.CreateItem(0)
Set BodyText = FSO.OpenTextFile(TempFile, 1)
With OutlookMsg
.HTMLBody = BodyText.ReadAll
.Subject = Range("A34").Text
.To = ""
.cc = ""
.Display
End With
Kill TempFile
Set BodyText = Nothing
Set OutlookMsg = Nothing
Set OutlookApp = Nothing
Set FSO = Nothing
End Sub