Agent Code to Attach Files and Detach Attachments into and from Domino Documents.

Mindwatering Incorporated

Author: Tripp W Black

Created: 07/08/2003 at 06:04 PM

 

Category:
Notes Developer Tips
Agents, LotusScript

Import Files into Lotus Notes
Script below performs an import from a folder space of files and adds them to Notes documents. Includes Find nth Number Character in a String to Label Attachments
importfiles.txtimportfiles.txt


Export Attachment Files from Notes Documents to the File System
Script below prompt and performs export of attachment in a Notes view of documents and saves the files/attachments to the file system into the folder specified. It has been update to NOT USE/INCLUDE THE doc.EMBEDDEDOBJECTS property since the call is no longer usable. The files exported have prepended the current document's UNID and a counter in case an attachment has the same name in the doc as another one in the same doc.

ExportFiles.txtExportFiles.txt




Example for crawling directories:
Sub checkForDirectory(pathname As String)
Dim tmpDirList List As String
Dim tmpdircount As Integer
Dim filename As String
Dim tmpfilename As String

tmpdircount = 1
filename$ = Dir$(pathname & separatore &"*.*", 16)
Do While filename$ <> ""

If Isfolder(pathname & separatore & filename$) Then
If (filename$<>"." And filename$<>"..") Then
tmpfilename$ = pathname & separatore & filename$

Let tmpDirList(tmpdircount) = tmpfilename$
Let dirlist(dircounter) = tmpfilename$
dircounter = dircounter + 1
tmpdircount = tmpdircount + 1
End If

End If
filename$ = Dir$()
Loop

Forall dirname In tmpDirList
Call checkForDirectory(dirname)
End Forall
End Sub

previous page