2015-12-31 24 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爲

相關問題