2017-03-06 2 views
0
Sub Initialize 

On Error GoTo e 
Dim session As New NotesSession, db As NotesDatabase, view As NotesView 
Dim nvec As NotesViewEntryCollection 
Dim c As integer 
Set db = session.currentdatabase 

Set view = db.getView("Locked Out Users") 
Set nvec = view.Allentries 

c = nvec.count 

If c > 0 Then 

Call nvec.Removeall(true) 

' Send notification 
Dim sarr(1) As String 
sarr(0) = "[email protected]" 
sarr(1) = "[email protected]" 

Dim mdoc As NotesDocument, rt As notesrichtextitem 
Set mdoc = db.createdocument 
mdoc.Form = "Memo" 
mdoc.Subject = "Removed " + CStr(c) + " Locked out users on mypage" 
Set rt = mdoc.Createrichtextitem("Body") 
Call rt.Appendtext("Removed " + CStr(c) + " Locked out users") 
Call rt.Addnewline(1) 
Call rt.Appendtext("Click to open lockout database") 
Call rt.Appenddoclink(db,"Lockout") 
Call mdoc.Send(False, sarr) 

End If 
Exit Sub 
e: 
Print Error,erl 
End Sub 

저는 Lotus Domino 초보자입니다. 몇 가지 질문이 있습니다.이 스크립트를 수정하여 지정된 이름의 잠긴 사용자 만 delate 할 수 있습니까? = GD 이름 DC에서 얼마나 예 로버트 코왈 스키/GD/회사 모두를 위해, 나는 직류를 지정한 방법을 모든 그룹의 사람을 삭제할 필요가 내 경우로터스 스크립트 잠금 사용자

Dim nam As NotesName 
Dim c As integer 
Set db = session.currentdatabase 
Set nam.OrgUnit1 = (“GD”) 
Set view = db.getView("Locked Out Users") 
Set nvec.OrgUnit1 = view.Allentries 

c = nvec.count 

If c > 0 Then 

:

나는 그런 일을 추가?

+0

FYI "GD"는 Lotus 세계에서 "dc"가 아닙니다. 그것은 "조직 단위"또는 "OU"입니다. –

답변

0

요청을 수행하는 데는 최소한 두 가지 방법이 있습니다. 먼저 "Locked Out Users"보기를 복사하고 OU 만 포함하도록 선택 수식을 변경할 수 있습니다.
다른 옵션은

dim doc as notesdocument 
dim nextDoc as notesdocument 

set doc = view.getfirstdocument() 
while not doc is nothing 
set nextDoc = view.getnextDocument(doc) 
set nam = new notesname(doc.getItemValue("[NAMEITEM]")(0)) 
if strcompare(nam.orgUnit1,"GD",5)=0 then 
    call doc.remove(true,false) 
end if 
set doc = nextDoc 
wend 
0
Sub Initialize 

On Error GoTo e 
Dim session As New NotesSession, db As NotesDatabase, view As NotesView 
Dim nvec As NotesViewEntryCollection 
Dim c As integer 
Set db = session.currentdatabase 
dim doc as notesdocument 
dim nextDoc as notesdocument 

set doc = view.getfirstdocument() 
while not doc is nothing 
set nextDoc = view.getnextDocument(doc) 
set nam = new notesname(doc.getItemValue("[NAMEITEM]")(0)) 
if strcompare(nam.orgUnit1,"GD",5)=0 then 
    call doc.remove(true,false) 
end if 
set doc = nextDoc 
wend 

Set view = db.getView("Locked Out Users") 
Set nvec = view.Allentries 

c = nvec.count 

If c > 0 Then 

Call nvec.Removeall(true) 

' Send notification 
Dim sarr(1) As String 
sarr(0) = "[email protected]" 
sarr(1) = "[email protected]" 

Dim mdoc As NotesDocument, rt As notesrichtextitem 
Set mdoc = db.createdocument 
mdoc.Form = "Memo" 
mdoc.Subject = "Removed " + CStr(c) + " Locked out users on mypage" 
Set rt = mdoc.Createrichtextitem("Body") 
Call rt.Appendtext("Removed " + CStr(c) + " Locked out users") 
Call rt.Addnewline(1) 
Call rt.Appendtext("Click to open lockout database") 
Call rt.Appenddoclink(db,"Lockout") 
Call mdoc.Send(False, sarr) 

End If 
Exit Sub 
e: 
Print Error,erl 
End Sub 

당신은 너의 responce에 대한 @umeli 감사 같은 것입니다. 지금은 라고 생각합니다.

관련 문제