Hi my friends
the following code to attaches all file in folder and send it by mail auto
I need to make the code not to sent mail auto but preview the mail and I will send it manual
[ Dim mess_body As String, StrFile As String, StrPath As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
'~~> Change path here
StrPath = "C:\Access"
With MailOutLook
.BodyFormat = olFormatRichText
.To = "test@testss.orwg"
.Subject = "test"
.HTMLBody = "test"
.NoAging = False
'~~> *.* for all files
StrFile = Dir(StrPath & "*.*")
Do While Len(StrFile) > 0
.Attachments.Add StrPath & StrFile
StrFile = Dir
Loop
'.DeleteAfterSubmit = False
.Send
End With
MsgBox "Reports have been sent", vbOKOnly
End Sub]
the following code to attaches all file in folder and send it by mail auto
I need to make the code not to sent mail auto but preview the mail and I will send it manual
[ Dim mess_body As String, StrFile As String, StrPath As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
'~~> Change path here
StrPath = "C:\Access"
With MailOutLook
.BodyFormat = olFormatRichText
.To = "test@testss.orwg"
.Subject = "test"
.HTMLBody = "test"
.NoAging = False
'~~> *.* for all files
StrFile = Dir(StrPath & "*.*")
Do While Len(StrFile) > 0
.Attachments.Add StrPath & StrFile
StrFile = Dir
Loop
'.DeleteAfterSubmit = False
.Send
End With
MsgBox "Reports have been sent", vbOKOnly
End Sub]