You are on page 1of 2

key:=@if(bcategory_tx="data";"lookup-data";bcategory_tx="access";"lookup-

access";"lookup-mobility");
@dbcolumn("";"";key;1)

sub initialize

dim s as new notessession


dim db as notesdatabase
dim coll as notesdocumentcollection
dim doc as notesdocument
dim rtitem as variant
dim filecount as integer
dim object as notesembeddedobject
dim result as variant

const max = 100000


filecount = 0
set db=s.currentdatabase
set coll=db.unprocesseddocuments
set doc=coll.getfirstdocument

while not doc is nothing


const notesmacro$ = "@attachmentnames"
result = evaluate(notesmacro$, doc)
if doc.hasembedded then
forall x in result
on error resume next
set object = doc.getattachment( x )
call object.extractfile("c:\isrdump\" &cstr(x))
call object.remove
end forall
set rtitem = doc.getfirstitem( "$file" )
call rtitem.remove
call doc.save( true, true )
else
set rtitem = doc.getfirstitem( "$file" )
call rtitem.remove
call doc.save( true, true )
end if
set doc=coll.getnextdocument(doc)
wend
end sub

set acl
sub initialize
on error resume next
dim i as integer
dim ws as new notesuiworkspace
dim uiview as notesuiview
dim dc as notesdocumentcollection
dim doc as notesdocument
set uiview = ws.currentview
set dc = uiview.documents
set doc = dc.getfirstdocument
i = 1
'dim session as notessession
'set session = new notessession
'dim doc as notesdocument
'set doc = session.documentcontext
'mailserver = doc.mailserver(0)
'messagebox mailserver
while not (doc is nothing)
print "done"
print i
i=i+1
dim db as new notesdatabase( doc.mailserver(0), doc.mailfile(0))
call db.grantaccess(doc.owner(0), acllevel_manager)
set doc = dc.getnextdocument (doc)
wend
end sub
%rem

sub initialize
dim ws as new notesuiworkspace
dim uiview as notesuiview
dim dc as notesdocumentcollection
dim doc as notesdocument
dim total as double
set uiview = ws.currentview
set dc = uiview.documents
set doc = dc.getfirstdocument
while not (doc is nothing)
total = total + 1
set doc = dc.getnextdocument (doc)
wend
messagebox total,, "total amount"
end sub

%end rem

You might also like