I cannot figure out how to get a handle to the PNAB object from a server agent - actually I have been asked to create a button that will be emailed to users that when clicked will basically refresh all the documents in their PNAB. Is there another way to accomplish this, seamlessly?
Here’s my button script:
Sub Click(Source As Button)
Dim nses_Cur As NotesSession
Dim ndb_PNAB As NotesDatabase
Dim nvw_Contacts As NotesView
Dim ndoc_Contact As NotesDocument
Dim int_Open As Integer
Set ndb_PNAB = nses_Cur.GetDatabase( "Localhost", "C:\Program Files\notes\data\names.nsf" )
int_Open = ndb_PNAB.Open("","")
Set nvw_Contacts = ndb_PNAB.GetView( "Contacts" )
Set ndoc_Contact = nvw_Contacts.GetFirstDocument
If ( ndoc_Contact Is Nothing ) Then
Messagebox "Error - did not get contact doc"
Exit Sub
End If
Do While Not ndoc_Contact Is Nothing
Call ndoc_Contact.ComputeWithForm( False, False )
Call ndoc_Contact.Save( True, False )
Set ndoc_Contact = nvw_Contacts.GetNextDocument( ndoc_Contact )
Loop
Messagebox "Successfully updated all Contact docs in address book"
End Sub
Thanks!
Ginni