Admin field population tool (String Only)

This code will allow you to populate any field you specify with any value you specify. Create a new agent and insert this code with the agent properties set to Selected Documents.
Custom Tools • Lotus Notes View • LotusScript

Sub Initialize
	Dim session As New NotesSession
	Dim workspace As New NotesUIWorkspace
	Dim db As NotesDatabase
	Set db = session.CurrentDatabase
	Dim collect As NotesDocumentCollection
	Set collect = db.UnprocessedDocuments
	If collect.count = 0 Then
		Msgbox " No Document(s) selected!", 0 + 16
		Exit Sub
	End If
	Dim fieldname As String
	fieldname = Inputbox( "Enter the name of the field you want to create or write to." , "Field Name")
	'exit if no fieldname is specified
	If fieldname = "" Then Exit Sub
	Dim fieldvalue As String
	fieldvalue = Inputbox( "Enter the value for the " & fieldname & " field." , "Field Value")
	'stamp all new values
	Call collect.StampAll( fieldname , fieldvalue )
	'refresh the current view
	Call workspace.viewrefresh     
End Sub


Posted by fbrefere001 on Monday April 1, 2002