LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Attach all Open Workbooks to email as separate files?


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


--
nbaj2k
------------------------------------------------------------------------
nbaj2k's Profile: http://www.excelforum.com/member.php...o&userid=36480
View this thread: http://www.excelforum.com/showthread...hreadid=567616

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Separate Excel Files in Separate Windows JTWood Excel Discussion (Misc queries) 3 May 7th 06 10:18 PM
How can I open from Web Excel Files in a separate Window? KUR Excel Discussion (Misc queries) 0 March 27th 06 09:06 PM
Open Excel files in separate sessions, not just separate windows? Bob at Dexia Design Excel Discussion (Misc queries) 1 October 18th 05 05:46 PM
How can I get existing Excel workbooks to open in separate windows Christy99 Excel Worksheet Functions 1 March 22nd 05 12:26 AM
Open an email and attach my excel file benb Excel Programming 1 December 21st 04 08:20 PM


All times are GMT +1. The time now is 08:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"