Hi I have share drive with the folder each user last name i.e
\Citrixuser\HR\perm\john\application\notesdata
\Citrixuser\HR\perm\Frank\application\notesdata
\Citrixuser\HR\perm\Willim\application\notesdata
I have a agent will first find the user folder with his name, if user folder is there then detach a files. Here is script but not sure how to check with each user name folder.
Error Goto Errhandler
Dim session As New notessession
Dim view As notesview
Dim doc As NotesDocument
Dim db As NotesDatabase 'current database
Dim filepathb As Variant
Dim filepatha As Variant
Dim userfoler As Variant
Dim fullpath As Variant
Set db = session.CurrentDatabase
Set view = db.GetView(“Clientinfo”)
Set doc = view.GetFirstDocument
filepathb = Evaluate(|@getprofilefield(“ClientProfile”;“FileDetPathBefore”)|)
filepatha = Evaluate(|@getprofilefield(“ClientProfile”;“FileDetPathAfter”)|)
’ above two Evaluate also not returing the values
If Right(filepathb,1) <> "" Then
filepathb = filepathb+""
End If
If Right(filepatha,1) <> "" Then
filepatha = filepatha+""
End If
While Not doc Is Nothing
userfolder=doc.GetItemValue("CFName")
fullpath=filepathb & userfolder(0) & filepatha
If Dir$(fullpath, 16 ) <>0 Then *** error here file not found
If doc.HasItem(“CNotesId”) Then
Set cnotesid=doc.GetFirstItem(“CNotesId”)
Else
Set cnotesid=doc.CreateRichTextItem(“CNotesId”)
End If
Forall o In cnotesid.embeddedobjects
If o.Type=EMBED_ATTACHMENT Then
Call o.extractfile(fullpath & o.source)
Print fullpath & o.source
End If
End Forall
Else
Print fullpath + " not found"
End If
Set doc=view.GetNextDocument(doc)
Wend
Exit Sub
’ Error handling
Errhandler:
Messagebox “Error” & Str(Err) & ": " & Error$
Exit Sub
End Sub
Thanks