Click to See Complete Forum and Search --> : CDO Attachments in Outlook


tschilbach
October 24th, 2001, 03:17 PM
I get a wierd error for the following code:

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

Dim objAttach As CDO.Message
Set objAttach = .Attachments.Add
With objAttach
.Type = CdoFileData
.Position = 0 ' render at first character of message
.Name = "c:\object\attachment.txt"
.ReadFromFile "c:\object\attachment.txt"
End With
objAttach.Name = "attachment.txt"
.Update

End Sub
#########################################################

######################Error##########################

Compile Error:

Invalid or Unqualified reference

####################################################

I am running Outlook 2000 SP1 on Windows 2000 with CDO Lib 1.21 and CDONTS as well. I do have these references selected in my application. What else could be the problem?


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