Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-30-2012, 04:18 AM
jillapass jillapass is offline emailing attachement, can't get it to work Windows 7 32bit emailing attachement, can't get it to work Office 2007
Novice
emailing attachement, can't get it to work
 
Join Date: Dec 2011
Posts: 26
jillapass is on a distinguished road
Default emailing attachement, can't get it to work

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
Reply With Quote
  #2  
Old 05-30-2012, 05:19 AM
jillapass jillapass is offline emailing attachement, can't get it to work Windows 7 32bit emailing attachement, can't get it to work Office 2007
Novice
emailing attachement, can't get it to work
 
Join Date: Dec 2011
Posts: 26
jillapass is on a distinguished road
Default

Solved by trial and error.

Used the line


.Attachments.Add Source:=ActiveDocument.Fullname


and this worked.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Emailing document with headers joeldodenhoff Outlook 1 02-20-2012 10:33 PM
emailing attachement, can't get it to work Creating a self emailing form s1lentb0b Word 1 09-22-2011 06:01 AM
emailing attachement, can't get it to work Email w/ large attachement stuck in Outbox. Please Help! smoky Outlook 11 07-20-2010 02:11 PM
emailing attachement, can't get it to work emailing links 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft