Hello,
I have documents sitting in a view that are printed by clicking on a button the runs an agent in LotusScript. The code is attached below.
I wish to have the name of the person who initiates my printing agent (the one who clicks the button) populated into a field in my document so I can see who’s done that work.
I have a feeling that the ReplaceItemValue coding may be the answer. I just don’t know how to represent the user’s name in the coding below.
Thank you, MAtthew
Sub Initialize
Dim workspace As New NotesUIWorkspace
Dim uiview As NotesuiView
Dim view As notesview
Dim doc As NotesDocument
Dim HowMany As Integer
Set uiview=Workspace.Currentview
Set view = uiview.view
Set Doc = View.GetFirstDocument
HowMany=Inputbox("How many Documents would you like to print?")
i=0
Do Until i=HowMany
Call UIView.SelectDocument( doc )
Call uiview.Print( 1, , , )
Call doc.ReplaceItemValue( "DatePrinted", Today )
Call doc.Save( True, True )
Call view.Refresh
i=i+1
Set doc = view.GetFirstDocument
Loop
End Sub