2015-12-31 20 views
-1

我需要帮助从csv文件中提取lotus Domino中names.nsf的组成员详细信息。 我从IBM网站下载提取相同的脚本,但细节在消息框中的到来,我需要在文本或CSV文件的详细信息,以便它可以继续使用。 请帮助如何在lotus domino中从names.nsf中提取csv文件中csv文件输出的详细信息

脚本

Sub Initialize 
 
\t Dim session As New NotesSession 
 
\t Dim dbCurrent As NotesDatabase 
 
\t Dim gman As New NotesGroupManager(True) 
 
\t 
 
\t Set dbCurrent = session.CurrentDatabase 
 
\t Call gman.LoadAddressBook(dbCurrent) 
 
\t 
 
\t ' Get information about all groups 
 
\t Call gman.LoadAllGroups ' what happens if you comment out this line? 
 
\t 
 
\t Dim groupList As Variant 
 
\t groupList = gman.CachedGroups 
 
\t 
 
\t Dim intCount As Integer 
 
\t Dim strGroupDesc As String 
 
\t Dim varSubgroups As Variant 
 
\t Dim varTemp As Variant 
 
\t Dim boolHasSubgroups As Boolean 
 
\t 
 
\t Forall group In groupList 
 
\t \t intCount = intCount + 1 
 
\t \t boolHasSubgroups = False 
 
\t \t strGroupDesc = "List tag: " & Listtag(group) & { 
 
Name: } & group.Name & { 
 
Description: } & group.Description & { 
 
Owner: } & atImplode(group.Owner, ", ") & { 
 

 
Members: } 
 
\t \t varTemp = group.Members 
 
\t \t Forall x In varTemp 
 
\t \t \t ' here's how to test whether a name is the name of a group. This is not as efficient as 
 
\t \t \t ' checking the Subgroups property, but I wanted to list the members in order (also, 
 
\t \t \t ' this will work even if we aren't in recursive mode). 
 
\t \t \t If gman.getGroup(x) Is Nothing Then 
 
\t \t \t \t ' the current member is not a group. 
 
\t \t \t \t strGroupDesc = strGroupDesc & x & ", " 
 
\t \t \t Else 
 
\t \t \t \t ' emphasize a group name by putting "<<< >>>" arround it. 
 
\t \t \t \t strGroupDesc = strGroupDesc & "<<<" & x & ">>>, " 
 
\t \t \t \t boolHasSubgroups = True 
 
\t \t \t End If 
 
\t \t End Forall 
 
\t \t 
 
\t \t If boolHasSubgroups Then 
 
\t \t \t strGroupDesc = Left$(strGroupDesc, Len(strGroupDesc) -2) & { 
 

 
AllMembers: } & atImplode(group.AllMembers, ", ") 
 
\t \t End If 
 
\t \t Msgbox Left$(strGroupDesc, Len(strGroupDesc) -2) 
 
\t End Forall 
 
\t 
 
\t If intCount = 0 Then 
 
\t \t Msgbox "No groups were found." 
 
\t End If 
 
End Sub

+1

你有没有研究过这个代码是如何工作的细节,抬头怎么写的LotusScript文件,并试图修改代码自行制作写数据到一个文件,而不是建立一个字符串,并以一个MsgBox显示它? –

+0

我研究的代码,并已经得到很少知道它是如何工作的,但我不如何写荷花剧本,否则我会自己修改了,我也有谷歌的各种事物理解,但我没有得到的东西,因此,在这里问,如果你可以分享任何链接,它也会有帮助 – Vino

+0

从这里开始:https://www-01.ibm.com/support/knowledgecenter/SSVRGU_9.0.1/com.ibm.designer.domino.main.doc /LSAZ_CHAPTER_4_FILE_HANDLING.html –

回答

0

打开使用Open Statement一个文本文件,然后循环槽您的数据和使用Print # Statement

开放也创造附加各行txtfile注册表该文件,如果它不存在。

PS:注意使用数字来识别文件,参见功能Freefile为

相关问题