
I want to email excel sheets in a workbook
Christina:
Below is a quick excert from a project I am working on
the application is for a Task, but just replace the
TaskItem with a Mailitem. In addition you need to add
the reference, "Microsoft Outlook 8.0 Object Libiary",
(Tools => References on the tool bar). Try the sheets as
mail attachments? You may not be able to seperate the
sheets from the file as attachments? Good Luck! Creating
the Email from another application is half the battle.
Bruce
Public Sub OriginatorTask()
'Creates task for originator
Dim objOutlook As Outlook.Application
Dim objOutlookTask As Outlook.TaskItem
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookTask = objOutlook.CreateItem(olTaskItem)
With Worksheets("Sheet Name")
objOutlookTask.Subject = ""
objOutlookTask.Body = ""(Application.UserName)
objOutlookTask.ReminderSet = True
objOutlookTask.DueDate = DateAdd("ww", 3,Now) 'Due 3
Weeks from Now
objOutlookTask.ReminderTime = DateAdd("ww", -1,
(objOutlookTask.DueDate)) 'Remind 7 Days from Due Date
objOutlookTask.StartDate = Now 'Due 3 Weeks from Now
objOutlookTask.Importance = (olImportanceHigh)
objOutlookTask.Categories = ""
End With
objOutlookTask.Display
'objOutlookTask.Save
Set objOutlook = Nothing
Set objOutlookTask = Nothing
End Sub