Click to See Complete Forum and Search --> : Adding an attachment to Outgoing Outlook Email


tschilbach
October 24th, 2001, 09:11 AM
Ok everyone,

I am no officially desparate... All I want is to be able to post the
following attachment to every message outgoing that is sent through my
Outlook Client. I have commented the code to better aide you in what I
am doing:

########### CODE ##############

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)

'Dim objAttach As Outlook.Attachment

Set objAttach = objAttachColl.Add ' add an attachment
With objAttach
.Type = CdoFileLink
.Position = 0 ' place at beginning of message
.Source = "\\server\bitmaps\honey.bmp" ' UNC name
End With
' must update the message to save the new info
objOneMsg.Update ' update the message

End Sub

########## CODE #####################

I get the folowing error message everytime:

Run-Time error '424'
Object Required

Ok, what object is it looking for and how do I tell outlook what the
existing object is? Please help me in determining what it is I am
doing wrong. Thank you in advance.

Timothy H. Schilbach
Messaging Administrator
Snapon Tools
tschilbach@snapon.com
262-656-6184



Timothy H. Schilbach
Alpha Omega Design Inc.
tschilbach@aodinc.com

Boumxyz2
October 24th, 2001, 10:20 AM
Did you add the mapi component ?