DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Kullandığım şu makroyu kendinize uyarlaya bilrsiniz.;
Private Sub LabelGonder_Click() ' MESAJ
If TextBox2.Value = "" Then
MsgBox "Mesaj Gönderim Tarihini, Belirtiniz ...!", vbCritical, "İşlem Hatası ..."
TextBox2.SetFocus
Exit Sub
End If
If TextBox1.Value = "" Then
MsgBox "Mesaj Gönderici E-Mail Adresini, Belirtiniz ...!", vbCritical, "İşlem Hatası ..."
TextBox1.SetFocus
Exit Sub
End If
If TextBox6.Value = "" Then
MsgBox "Mesaj Alıcı E-Mail Adresini, Belirtiniz ...!", vbCritical, "İşlem Hatası ..."
TextBox6.SetFocus
Exit Sub
End If
If TextBox3.Value = "" Then
MsgBox "Konu Başlığını, Belirtiniz ...!", vbCritical, "İşlem Hatası ..."
TextBox3.SetFocus
Exit Sub
End If
If TextBox4.Value = "" Then
MsgBox "Konu Açıklamasını, Boş Geçmeyiniz ...!", vbCritical, "İşlem Hatası ..."
TextBox4.SetFocus
Exit Sub
End If
If imzayetkilisi = "" Then
MsgBox "Gönderen Yetkiliyi, Belirtiniz ...!", vbCritical, "İşlem Hatası ..."
Exit Sub
End If
If TextBox5.Value = "" Then
MsgBox "Telefon No'yu, Belirtiniz ...!", vbCritical, "İşlem Hatası ..."
TextBox5.SetFocus
Exit Sub
End If
'NOT : "Tools ->References-> ( Microsoft Outlook X.X Object Library ) " İŞARETLEYİNİZ ...
Dim app As Outlook.Application
Dim posta As Outlook.MailItem
Application.DisplayAlerts = False
Set app = CreateObject("Outlook.Application")
Set posta = app.CreateItem(olMailItem)
With posta
.To = TextBox7.Text '( KİME ) ALICI
.CC = TextBox1.Text '( KİMDEN ) GÖNDEREN
.Subject = TextBox3.Text 'KONU BAŞLIĞI
.Body = "MERHABA ; " & Chr(13) & Chr(13) & TextBox4.Text & (" ") & TextBox2.Text & Chr(13) & "İYİ GÜNLER ..." & Chr(13) & "TLF :" & (" ") & TextBox5.Value & Chr(13) & Chr(13) & imzayetkilisi ' KONU AÇIKLAMASI
.Attachments.Add ""
.Display
End With
Application.DisplayAlerts = True
For TEMIZLE = 1 To 6
Controls("TextBox" & TEMIZLE) = "" 'TEMİZLEME
Next
End Sub
Kullandığım şu makroyu kendinize uyarlaya bilrsiniz.;
Private Sub LabelGonder_Click() ' MESAJ
If TextBox2.Value = "" Then
MsgBox "Mesaj Gönderim Tarihini, Belirtiniz ...!", vbCritical, "İşlem Hatası ..."
TextBox2.SetFocus
Exit Sub
End If
If TextBox1.Value = "" Then
MsgBox "Mesaj Gönderici E-Mail Adresini, Belirtiniz ...!", vbCritical, "İşlem Hatası ..."
TextBox1.SetFocus
Exit Sub
End If
If TextBox6.Value = "" Then
MsgBox "Mesaj Alıcı E-Mail Adresini, Belirtiniz ...!", vbCritical, "İşlem Hatası ..."
TextBox6.SetFocus
Exit Sub
End If
If TextBox3.Value = "" Then
MsgBox "Konu Başlığını, Belirtiniz ...!", vbCritical, "İşlem Hatası ..."
TextBox3.SetFocus
Exit Sub
End If
If TextBox4.Value = "" Then
MsgBox "Konu Açıklamasını, Boş Geçmeyiniz ...!", vbCritical, "İşlem Hatası ..."
TextBox4.SetFocus
Exit Sub
End If
If imzayetkilisi = "" Then
MsgBox "Gönderen Yetkiliyi, Belirtiniz ...!", vbCritical, "İşlem Hatası ..."
Exit Sub
End If
If TextBox5.Value = "" Then
MsgBox "Telefon No'yu, Belirtiniz ...!", vbCritical, "İşlem Hatası ..."
TextBox5.SetFocus
Exit Sub
End If
'NOT : "Tools ->References-> ( Microsoft Outlook X.X Object Library ) " İŞARETLEYİNİZ ...
Dim app As Outlook.Application
Dim posta As Outlook.MailItem
Application.DisplayAlerts = False
Set app = CreateObject("Outlook.Application")
Set posta = app.CreateItem(olMailItem)
With posta
.To = TextBox7.Text '( KİME ) ALICI
.CC = TextBox1.Text '( KİMDEN ) GÖNDEREN
.Subject = TextBox3.Text 'KONU BAŞLIĞI
.Body = "MERHABA ; " & Chr(13) & Chr(13) & TextBox4.Text & (" ") & TextBox2.Text & Chr(13) & "İYİ GÜNLER ..." & Chr(13) & "TLF :" & (" ") & TextBox5.Value & Chr(13) & Chr(13) & imzayetkilisi ' KONU AÇIKLAMASI
.Attachments.Add ""
.Display
End With
Application.DisplayAlerts = True
For TEMIZLE = 1 To 6
Controls("TextBox" & TEMIZLE) = "" 'TEMİZLEME
Next
End Sub
size hazırladığım dosyayı incelermisiniz...
dosyayı açınca hata mesajı alırsanız "Tools ->References-> ( Microsoft Outlook X.X Object Library ) " İŞARETLEYİNİZ ...
konuyla ilgileneceğim. ama az zamana ihtiyacım var.