N
nbaj2k
I figured out how to attach the active workbook to an email, but is
there away to attach all open workbooks to a single email as separate
files?
I have no idea how to do it. What I have below is how I'm attaching
the active sheet.
Anyway to select all open workbooks so I can set the macro to open run
and attach all of them? I know how to do all of it except attaching
all of them.
Anyone have any ideas or done this before?
Thanks,
~J
Application.ScreenUpdating = True
Dim myattachment
Dim olNs As Object
Dim olMailItem
Dim olMail As Object
Dim olApp As Object
Dim ATTACH1 As String
ATTACH1 = ACTIVEWORKBOOK.FULLNAME
Set olApp = CreateObject("Outlook.Application")
Set olNs = olApp.GetNamespace("MAPI")
olNs.Logon
Set olMail = olApp.CreateItem(olMailItem)
olMail.Display
olMail.To = "RECIPIENTS"
olMail.CC = "RECIPIENTS"
'olMail.BCC =
olMail.Subject = "Daily Report for " & Format(Date - 1, "mmm-d-yy")
olMail.Body = "MESSAGE"
Set myattachment = olMail.Attachments
myattachment.Add ATTACH1
'Stop
''olMail.Send
'olNs.Logoff
'Set olNs = Nothing
'Set olMail = Nothing
'Set olApp = Nothing
End Sub
there away to attach all open workbooks to a single email as separate
files?
I have no idea how to do it. What I have below is how I'm attaching
the active sheet.
Anyway to select all open workbooks so I can set the macro to open run
and attach all of them? I know how to do all of it except attaching
all of them.
Anyone have any ideas or done this before?
Thanks,
~J
Application.ScreenUpdating = True
Dim myattachment
Dim olNs As Object
Dim olMailItem
Dim olMail As Object
Dim olApp As Object
Dim ATTACH1 As String
ATTACH1 = ACTIVEWORKBOOK.FULLNAME
Set olApp = CreateObject("Outlook.Application")
Set olNs = olApp.GetNamespace("MAPI")
olNs.Logon
Set olMail = olApp.CreateItem(olMailItem)
olMail.Display
olMail.To = "RECIPIENTS"
olMail.CC = "RECIPIENTS"
'olMail.BCC =
olMail.Subject = "Daily Report for " & Format(Date - 1, "mmm-d-yy")
olMail.Body = "MESSAGE"
Set myattachment = olMail.Attachments
myattachment.Add ATTACH1
'Stop
''olMail.Send
'olNs.Logoff
'Set olNs = Nothing
'Set olMail = Nothing
'Set olApp = Nothing
End Sub