Explode group to individual mail addresses by lotusscript

When I press F9 in lotus client, all of the group members are dissociated in the TO/CC/BCC fields. How to do it from lotusscript?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

F9 is similar to Call Uidoc.refresh
Here's the recursive function (nested groups) from my CodeLibrary (template: http://www.openntf.org/Projects/pmt.nsf/ProjectLookup/Code%20Library) that returns array of all groups the user belongs to:
Function GetAllUsersInGroup( groupname As String, Server As String, maxdepth As Integer ) As Variant
	This function gets all the users in any group, including nested subgroups.
	This is a RECURSIVE function, so be careful when modifying it.
	MAXDEPTH is used to regulate how far down in group levels it can go.
	If checking ACL groups, 6 is the limit, for mail groups its 20 -- but this can change with Domino versions in the future.

	This sample code is distributed freely with only one obligation. You must distribute this code as a whole, including these comments, if you distribute it or re-use it at all. 
	For help, please contact
	Andrew Pollack
	Northern Collaborative Technologies

      ' use static variables so that you can avoid repeatedly
      ' getting a handle to the same resources.
      Static nab As notesdatabase
      Static nabview As notesview
      Static groupview As notesview
      Static foundlist List As String
      Static checkedgroups List As String
      Static depth As Integer

      ' this is the list containing the results to return
      Dim returnlist List As String

      ' just a stray string variable to be used
      Dim tempstring As String

      ' set this to return the empty list, in case we have to exit due to error
      getallusersingroup = returnlist

      ' since depth is a static variable, each recursive call to this
      ' function will increase its value.  We can also decrease its
      ' value so we know when we're back to the initial call.
      If depth => maxdepth Then Exit Function  ' don’t look deeper then n nested groups
      depth = depth + 1

      ' check to see if we haven't already connected to the nab & views
      ' if not, connect now.
      If nab Is Nothing Then Set nab = New notesdatabase(server,"NAMES.NSF")
      If nab Is Nothing Then Exit Function
      If nabview Is Nothing Then Set nabview = nab.getview("($ServerAccess)")
      If groupview Is Nothing Then Set groupview = nab.getview("($VIMGroups)")
      If groupview Is Nothing Then Exit Function
      If nabview Is Nothing Then Exit Function

      ' declarations
      Dim collection As notesdocumentcollection
      Dim doc, checkdoc As notesdocument
      Dim v As Variant
      Dim count As Integer
      Dim usercount As Integer
      Dim user As notesname

      ' Now we get to the meat of the function
      Set doc = groupview.getdocumentbykey(groupname, True) ' first, find the group

      If doc Is Nothing Then Exit Function ' there is no group

      Forall member In doc.members ' for each entry in the the group
            tempstring = Ucase$(member)
            ' *******************************************************
            ' make sure we haven't already checked this entry
            If Not Iselement(returnlist(tempstring)) Then
                  If Not Iselement(foundlist(tempstring)) Then
                        If Not Iselement(checkedgroups(tempstring)) Then
            ' *******************************************************
                              Set checkdoc = groupview.getdocumentbykey(tempstring, True)
                              If checkdoc Is Nothing Then
                              ' treat as a user, add them to the return and found lists
                                    foundlist(tempstring) = "1"
                                    returnlist(tempstring) = "1"
		      		    ' this is a new group to check
                              ' so we recursively call this very function with the new groupname
                                    checkedgroups(tempstring) = "1"
                                    v = GetAllUsersInGroup( tempstring, server, maxdepth )
                                    Forall newmember In v
                                          ' add the results from the recursive call to the return lists
                                          returnlist(Listtag(newmember)) = "1"
                                          foundlist(Listtag(newmember)) = "1"
                                    End Forall
                              End If
                        End If
                  End If
            End If
      End Forall

      ' whew, now just return the list of all we found, plus all those found by
      ' any recursive calls we made, and the calls they made, and the calls they made, ...
      getallusersingroup = returnlist
      depth = depth -1

      If depth = 0 Then
	' this exit will be the last recursion, so delete the static list so we can run again if we need!
            Erase foundlist
            Erase checkedgroups
      End If

End Function

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Looks like my understanding was wrong. :(
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Amitava_MukherjeeAuthor Commented:
I probably assigned all points to "madheeswar:", but I wanted to share "mbonaci:" and "madheeswar:" both as both have given me right solution, "madheeswar" give a better solution for me as it works for local as well as server group. My mistake, sorry for that, any way to split the points to both of them, I dont know, sorry again.
Use the Request Attention link on the top and put your comments to split points.
Again: use the journaling function, so even mail sent by applications gets logged (and thus whitelisted)
Amitava_MukherjeeAuthor Commented:
thanx to all of you, as i said earlier, the problem is solved by the mixture of the 1st two solutions. thanx once again
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.