Subject: RE: Creating an Anonymous document using script
I have tested a workaround (and it worked) that is on the IBM Website at this address :http://www-1.ibm.com/support/docview.wss?uid=swg21102782
Sub Initialize
Dim s As New notessession
’ scrcdb is the source database.
Dim db As notesdatabase
Dim coll As notesdocumentcollection
’ doc is source document and doc2 is new document without $Updated field
Dim doc As notesdocument
Dim doc2 As notesdocument
'AnonymItem will be used to add $Anonymous field to doc2
Dim AnonymItem As Notesitem
Set db=s.currentdatabase
Set coll=db.unprocesseddocuments
For i = 1 To coll.count
Set doc=coll.getnthdocument(i)
Call doc.removeitem(“$UpdatedBy”)
Set doc2=New NotesDocument(db)
Call doc.copyallitems(doc2)
’ $UpdatedBy field will be deleted only if $Anonymous field exists
If Not (doc.HasItem( “$Anonymous” )) Then
Set AnonymItem = New NotesItem( doc2, “$Anonymous”, “1”)
End If
Call doc2.save(True,True)
Call doc.remove(True)
Next
End Sub
Be careful, if later you delete the field $Anonymous from the document and save it, the $UpdateBy, $Revisions, are automatically recreated.