When you open the form, the Item_Open event is triggered, which in turn calls the Item_Open function. It has several main tasks:
Because the EnhancedLitCrit form consists of several pages, it uses script to make sure that the right page is displayed. Displaying the wrong page could, for example, prevent you from editing your own critique, or let someone else make changes to a critique that is not theirs.
This function, whose code you can see in EnhancedLitCrit, performs the following actions:
CurrentUser = Application.GetNameSpace("MAPI").CurrentUser
If Item.UserProperties("OldUserName") = CurrentUser Then
If UserProperties("bibNo") <> 0 Then
' This person has reviewed a library item. Show HALF-READ form.
MyInspector.ShowFormPage("HalfRead")
MyInspector.HideFormPage("Others")
MyInspector.SetCurrentFormPage("HalfRead")
Set MyPage = MyInspector.ModifiedFormPages("HalfRead")
Else
' Not a library item. Show CURRENT USER form.
MyInspector.ShowFormPage("CurrentUser")
MyInspector.HideFormPage("Others")
MyInspector.SetCurrentFormPage("CurrentUser")
Set MyPage = MyInspector.ModifiedFormPages("CurrentUser")
End If
Else
' Reader is not submitter. Show DEFAULT (Others) form.
MyInspector.SetCurrentFormPage("Others")
Set MyPage = MyInspector.ModifiedFormPages("Others")
End If
MyInspector.ShowFormPage("HalfRead")
. . .
MyInspector.SetCurrentFormPage("HalfRead")
For more information, see Displaying the Form's Pages.
Now, through the use of one or possibly two dialog boxes, the user has the opportunity to choose a title to review from the FmLib database. These are the steps in this task:
If UserProperties("Item Title") = "" Then
Set objCDOSession = Application.CreateObject("MAPI.Session")
objCDOSession.LogOn "",False,False,False
Set objSession = Application.GetNameSpace("MAPI")
Set MyAddressLists = objSession.AddressLists("Global Address List")
Set MyEntry = MyEntries.Item(CurrentUser)
LogOn = MyEntry.Address ' format: \o=\ou=\cn=\cn=alias
Set ObjCritique = Application.Createobject("LitCritC.Critique")
objCritique.ChooseTitle BibNo, Title, Authors,MediaType, ObjectID, CStr(LogOn), CStr(ServerName)