I have searched the forum and many books and websites but I am still am not able to find how to rename the file. After I am done with the file I want to rename it .old so that the agent does not run on it again.
sendfile is what I want to rename and I know once I get the values I can use
Name sendfile As newname
sendfiles value is “\servername\dir\file.txt”
but I am not sure how do it and have not found any postings that can help me. I am still new to LS so I know I am in the right area but there are a few different ways to do this and I am not show how to word the syntax or where to place it at this point.
Any help would be appreciated.
Here is my code:
Function ProcessFile (sendfile As String, session As Notessession, db As Notesdatabase) As Integer
’ ready a notes memo, the body field is a richtext type.
Dim dbdoc As Notesdocument
Dim body As Notesrichtextitem
Dim FileAtt As String
Set dbdoc = New NotesDocument( db )
dbdoc.Form = "Memo"
’ open ascii file and read every line
fileNum% = Freefile()
Open sendfile For Input As fileNum%
’ Read each line of the file.
Line Input #fileNum%, txt1
Line Input #fileNum%, txt2
Line Input #fileNum%, txt3
Close fileNum%
’ Gets the File Name
StartPos = Instr ( txt3 , "\") +1
EndPos =Instr (txt3 , ".")
FileAtt = Mid$(txt3 , StartPos , EndPos - StartPos)
’ Mail Info
dbdoc.SendTo = txt1
dbdoc.CopyTo = ""
dbdoc.BlindCopyTo = ""
dbdoc.Subject = "Delivery Failure"
Set body = New NotesRichTextItem( dbdoc, "Body" )
Call body.AppendText(clause & Chr$(10))
Set body = New NotesRichTextItem( dbdoc, "Body")
Call Body.EmbedObject(EMBED_ATTACHMENT, "", ASCIIDir+"\"+FileAtt+".txt")
dbdoc.PostedDate = Now
dbdoc.SaveMessageOnSend = True
Call dbdoc.Send( False)
'Close File
Close fileNum%
End Function