Plz help Want to create a new Excel file always And also want to send it By mail

Hi,Plz help me with this

I want to put document in an excel file n send that file via mail using Embeadobject. But prob. is This excel file always contains prev. document with new one.

Like i have 10 documents n i have put that in to a excel file.If again my agent runs and find 5 document then it will overwriting prev. 5 documents But Still rest of 5 old documents is there.Means again 10 documents 5 new + 5 old

If there is a way by which we can always generate a new excel file AND also can send it via mail Then plzzzzzzzzzzzz

Help me .PLZ PLZ PLZ SEND ME SOME CODE

Or give me some advice.

Great Help

Thanks A lottttttt

Regards

Mudit

Subject: Plz help Want to create a new Excel file always And also want to send it By mail

Mudit hi,

Are u able to create excel file?

Subject: Plz help Want to create a new Excel file always And also want to send it By mail

Hi

you need to right an agent and use the loop over there and once the loop is over make the doc as assigned to next doc .and after assigned make sure that make the temp doc as nothing

Subject: Plz help Want to create a new Excel file always And also want to send it By mail

hi see the following code and try.

Sub SendMail

On Error Goto ErrHandler

Dim Maildoc As NotesDocument

Dim rtitem As NotesRichTextItem

Dim object As NotesEmbeddedObject

Dim memberitem As NotesItem



	

Set Maildoc = db.createdocument

Maildoc.Form = "Memo"

Maildoc.SendTo = 

Maildoc.CopyTo = ""

	

Maildoc.Subject = "Daily Report Csvwise

Set rtitem = New notesrichtextitem(Maildoc , "Body")

Call rtitem.appendtext("Pls find attached, the report containing details of queries received between  " &  tempdate.DateOnly & " : " & tempdate.TimeOnly & " and  " & tempdate2.DateOnly & " : " &tempdate2.TimeOnly)

Call rtitem.AddNewLine( 2 )

Set object = rtitem.EmbedObject( EMBED_ATTACHMENT, "", excelPath)

Call rtitem.AddNewLine( 2 )

Call rtitem.appendtext("Note *:")

Call rtitem.AddNewLine( 1 )

Call rtitem.appendtext("Please do not reply as it is a system generated mail. For assistance you can contact:     ))

Call Maildoc.Send(False, False)



Exit Sub

ErrHandler:

	'================Log Error

Call aLog.LogError( Err, "Error in SendMail:Daily Csvwise " & Str(Err) & " at " & Erl & ": " & Error$ )

Call aLog.Close

End Sub

Here Ecxel path is path of ur excel file. U can write a “send” function in ur agent and call this fuction in “initialize” sub routin ,after generating that excel file using

Call send

method.

i hope that much will be sufficient for u.

bye take care