Link to home
Start Free TrialLog in
Avatar of smeyer4314
smeyer4314Flag for United States of America

asked on

Getting Short Name from NAB for a member of a group

I'm trying to get the short name field out of the nab for individual members of a group in the nab.

My attempts so far are below with the problem (at least the first one) is that the evaluate statement for
searchname is evaluating to a blank.  The first part works (it brings back the group members names in the following format CN = John Smith/OU=xyz/O=abc).  So i basically want to convert that to John Smith, go to the $VIMPeople View of the NAB and extract the shortname from the document.

Any ideas would be appreciated.

Thanks

smeyer4314

      Dim nabdb As notesdatabase
      Dim nabdoc As notesdocument
      Dim nabdoc2 As notesdocument      
      Dim nabview As notesview
      Dim nabview2 As notesview
      Dim nabsession As New notessession
      
      filenum = Freefile()
      Open "c:\my documents\group_list.txt" For Output As #Freefile
      
      srv = "myserver"
      dbn = "names.nsf"
      
      Set nabdb = New notesdatabase(srv,dbn)
      Set nabview = nabdb.getview("Groups")
      
      Set nabview2 = nabdb.getview("$VIMPeople")
      
      docname = "MyLookupGroup"
      Set nabdoc = nabview.getdocumentbykey(docname,True)
      
      If nabdoc Is Nothing Then
            Msgbox("no document")
      Else
            Forall member In nabdoc.members
                  Print #filenum, member
                  Msgbox(member)
' ok to here
'                  searchname = Evaluate(|@name([Abbreviate];member)|)
                            tname = searchname(0)
                  Msgbox (tname)      
' returns a blank tname
'            
                  Set nabdoc2 = nabview2.getdocumentbykey(tname,True)
                  If nabdoc2 Is Nothing Then
                        Msgbox("no document on internet name lookup")
                  Else
                        short_name = nabdoc2.shortname(0)
                        Print #filenum, short_name
                        
                  End If
            End Forall
      End If
      
      Close #fileNum
      
      
      
End Sub
ASKER CERTIFIED SOLUTION
Avatar of qwaletee
qwaletee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of smeyer4314

ASKER

Qwaltee;

Thanks, that worked.

Steve m