Wednesday, May 30, 2012

Clear Lotus Notes "Recent Contacts" List

Do you have Lotus Notes 8.x and don't want to have contacts in your user's Recent Contacts list?  You can turn this off but maybe you just want to clear it to see if there is an issue.  Instead of trying to walk your users through deleting the information, just send them a button that says "Click Here" with the below Lotus Script code:


%REM
    Agent Remove Recent Contacts   
    Description: Clear recent contacts with just a click
%END REM

Option Declare
Sub Click(Source As Button)
    Dim ses As New NotesSession
    Dim v As NotesView
    Dim col As NotesViewEntryCollection
    Dim entry As NotesViewEntry       
    Dim doc As NotesDocument   
    Dim x As Integer
    x = 0
    ' For The Current User in The Current Session, Get All The NABs
    Forall books In ses.addressbooks
        'Check If The Current NAB is Private or Public
        'If The NAB Is Private, Then It Should Be Your Personal NAB
        If books.isprivateaddressbook Then
            'Verify if The NAB is Open, If Not, Open it
            If Not(Books.isopen) Then
                Call Books.open("",books.filename)
            End If
            Set v = books.getview("RecentCollaborators")
            Set col = v.AllEntries
            Set entry = col.GetFirstEntry()
            While Not(entry Is Nothing)
                Set doc = entry.Document
                doc.Remove(True)
                x = x + 1
                Set entry = col.GetNextEntry(entry)
            Wend           
            Print "Removed " & x & " Recent contacts"           
        End If
    End Forall
End Sub

Enable an Agent then Sign It With The Server ID

Do you need to turn an Agent Off or On -- but keep it signed by your server?  This script will do the trick.  It is especially useful if you are sending email from the agent but don't want it coming from anyone other than your server.  Name your agent in the code, add this to a button in your application and you'll be all set!
Option Public
Option Declare
'Declarations.
Dim debug As Integer
Dim sdoc As NotesDocument

Sub Initialize
   
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim agent As NotesAgent
    Dim adminp As NotesAdministrationProcess
    Dim agentFound As Integer
    Dim nam As NotesName
    Dim noteid As String
   
    Set db = session.CurrentDatabase
    agentFound = False
   
    'Get the agent.
    Forall a In db.Agents
        If ( a.Name = "Some Agent Name" ) Then
            Set agent = a
            agentFound = True
            Print "Agent " + agent.Name + " found."
            Exit Forall
        End If
    End Forall
   
    'Enable the agent.
    If agentFound Then
        agent.IsEnabled = True
        Call agent.Save
        Print "Agent " +agent.Name + " enabled."
    End If
   
    'Issue AdminP request to sign database with server's ID.
    Set nam = session.CreateName( db.Server )
    Set adminp = session.CreateAdministrationProcess( nam.Abbreviated )
    noteid$ = adminp.SignDatabaseWithServerID( nam.Abbreviated, db.FilePath )
    Print "Issued AdminP request to sign database with server's ID."
   
End Sub

Tuesday, May 29, 2012

Coming soon.....a review of my new Samsung Galaxy Note phone!

I finally broke down and updated my phone from the Samsung Galaxy S (Captivate) to the very large and very useful Samsung Galaxy Note.  I've purchased a case and a cover for it.  One of my most favorite phones to date.