Thread: Attachments
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gerry[_8_] Gerry[_8_] is offline
external usenet poster
 
Posts: 1
Default Attachments

I am trying to send Excel worksheets to mail receipients.
The worksheets are in a workbook. I can get the workbook
to send using this code but I need it to send the
WORKSHEET only. Any ideas, please.

Sub ATest()

Code being used:

Dim xlApp As New Excel.Application, xlItem As
Excel.Sheets
Dim olApp As New Outlook.Application, olItem As
Outlook.MailItem
Dim olAttachments As Outlook.Attachments
Dim strMess As String, strTitle As String, strTo As
String

Set olItem = olApp.CreateItem(olMailItem)
strTo = "
strMess = "New Worksheet Attached"
olItem.Subject = "New Worksheet "
olItem.to = strTo
olItem.Attachments.Add ("P:\MyFolder\activities.xls")
olItem.Body = strMess
olItem.Send
Set olItem = Nothing

End Sub