![]() |
|
#1
|
|||
|
|||
![]()
I have the following code, it emails, but doesn't include the attachment,
what have I done wrong ? Code:
Dim bStarted As Boolean Dim oOutlookApp As Outlook.Application Dim oItem As Outlook.MailItem ' Check if Outlook is running. If it is not, start Outlook On Error Resume Next Set oOutlookApp = GetObject(, "Outlook.Application") If Err <> 0 Then Set oOutlookApp = CreateObject("Outlook.Application") bStarted = True End If MsgBox pathstring Set oItem = oOutlookApp.CreateItem(olMailItem) With oItem .Subject = "AFRF" + ClForename + " " + ClSurname .Body = "Here is your Client Review Feedback" .Attachments.Add Source:=pathstring, DisplayName:="AFRF" .To = "jill.pass@christiescare.com" .Send End With ' Close Outlook if it was started by this macro. If bStarted Then oOutlookApp.Quit End If 'Clean up Set oItem = Nothing: Set oOutlookApp = Nothing |
#2
|
|||
|
|||
![]()
Solved by trial and error.
Used the line .Attachments.Add Source:=ActiveDocument.Fullname and this worked. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Emailing document with headers | joeldodenhoff | Outlook | 1 | 02-20-2012 10:33 PM |
![]() |
s1lentb0b | Word | 1 | 09-22-2011 06:01 AM |
![]() |
smoky | Outlook | 11 | 07-20-2010 02:11 PM |
![]() |
rwab | Office | 1 | 05-16-2009 09:21 AM |
Emailing a word doc NOT as an attachment | tigger66 | Word | 0 | 01-15-2009 05:30 PM |