![]() |
|
#8
|
||||
|
||||
|
Without seeing your code, which you've still not provided, I can't tell you how/where to add it to that. Here's a generic demonstration. The code assumes you're using early binding:
Code:
Sub Demo()
Dim objOutlook As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objMailItem As Outlook.MailItem
Dim objRecipient As Outlook.Recipient
Set objOutlook = New Outlook.Application
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objMailItem = objOutlook.CreateItem(olMailItem)
With objRecipient
.Add ("John Wilson")
.Type = olTo
.Add ("Adrian Fearnley")
.Type = olTo
.Add ("Chuck Feathers")
.Type = olcc
End With
With objMailItem
.Subject = "Financial Analysis"
.Body = "Hi John, Adrian & Chuck," & vbCr & "I hope all's well. Here's the financial analysis." & _
vbCr & vbCr & "Regards" & Environ("UserName")
.Attachments.Add ("C:\Users" & Environ("UserName") & "\Documents\Financials.xls")
.Logon , , True
.Send
End With
Set objMailItem = Nothing: Set objNameSpace = Nothing: Set objOutlook = Nothing
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Programatically Managing Word Document Structure
|
mlbliss | Word VBA | 3 | 11-07-2012 07:42 PM |
Apply font color programatically using VBA Word
|
divakarganta | Word VBA | 3 | 08-08-2012 08:05 PM |
How to send an email to all contacts I ever send an email to?
|
JSYdeJong | Outlook | 1 | 11-02-2011 07:22 PM |
Can't send email
|
helpplease | Outlook | 6 | 12-21-2008 06:00 AM |
| Programatically open Outlook folder (set focus) using RDO? | NicMic | Outlook | 0 | 01-10-2008 03:27 PM |