VBA ve görünüm üzerinden çoklu ekleri olan bir e-posta göndermeye çalışıyorum.E-posta veya tüm dizin (VBA) içinde göndermek için birden fazla dosya eklemek V123 ve diğer güvenlik açılarıyla (VBA)
Bir eke/dosyaya yol belirlediğimde ve birden çok ek ekleyebiliyorsam, çalıştığım kod da tam olarak ne olduklarını bildiğim halde ileriye hareket etmeyeceğim - dosya adları kadar farklı sayımlar da olacak .
Aşağıdaki örnekte gösterildiği gibi joker karakterleri kullanarak göndermek isterim ancak sanırım bir dizine işaret eden bir çeşit döngü kullanmam gerekecek.
Çözüme bir tonluk baktım ama henüz özel durumumla çalışan bir şey görmedim.
Private Sub Command22_Click()
Dim mess_body As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.To = "[email protected]"
.Subject = "test"
.HTMLBody = "test"
.Attachments.Add ("H:\test\Adj*.pdf")
'.DeleteAfterSubmit = True
.Send
End With
MsgBox "Reports have been sent", vbOKOnly
End Sub
kullanın [DIR] (http://stackoverflow.com/questions/10380312/loop-through-files-in-a-folder-using-vba/10382861#10382861) –
için teşekkür ederiz cevabın. .Attachments.Add Dir ("H: \ test \") denedim ve "Bu dosyayı bulamıyorum. Yolu ve dosya adını doğrulayın" diyerek bir hata aldım. – gfuller40