Subject: RE: Create button in lotus script
I have a document with access to database for each people. I go in a document and when i click on a button, the code is generate with the people’access. So, the code changes depends of access people. This code is for add icone of database that the people has access on there workspace.
The button in a document with access’people:
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim ws As New NotesUIWorkspace
Dim uidoc As notesuidocument
Set uidoc = ws.CurrentDocument
Dim doc As NotesDocument
Set doc = uidoc.Document
Set newdoc = db.CreateDocument
newdoc.form = "*"
newdoc.sendto = uidoc.fieldgettext("Nom")
newdoc.subject = "Installation des tuiles Notes demandées"
Set rti=New NotesRichTextItem(newdoc, "Body")
i% = 0
Forall item In doc.cxemplacement
If Left(item,6) <> "Défaut" And item <> "*" Then
If Left(item,18) = "CCD_NOTES_SERVICES" Then
Call rti.AppendText("serveur:=""" & Left(item,18) & """;")
Call rti.addnewline(1)
pos% = Instr(Right(item,Len(item) -19), "\")
If pos% <> 0 Then
Call rti.appendtext("base:=""" & Left(Right(item,Len(item) -19), pos%-1) & "/" & Right(Right(item,Len(item) -19), Len(Right(item,Len(item) -19)) - pos%) & """;")
Else
Call rti.appendtext("base:=""" & Right(item,Len(item) -19) & """;")
End If
Call rti.addnewline(1)
Else
Call rti.AppendText("serveur:=""" & Left(item,9) & """;")
Call rti.addnewline(1)
pos% = Instr(Right(item,Len(item) -10), "\")
If pos% <> 0 Then
Call rti.appendtext("base:=""" & Left(Right(item,Len(item) -10), pos%-1) & "/" & Right(Right(item,Len(item) -10), Len(Right(item,Len(item) -10)) - pos%) & """;")
Else
Call rti.appendtext("base:=""" & Right(item,Len(item) -10) & """;")
End If
Call rti.addnewline(1)
End If
Call rti.AppendText("temp := @DbExists(serveur:base);")
Call rti.addnewline(1)
Call rti.AppendText("@If(temp = @False; @Return("""");")
Call rti.addnewline(1)
Call rti.AppendText("@Do(@Command([WindowWorkspace]);")
Call rti.addnewline(1)
Call rti.AppendText("@Command([AddDatabase]; serveur:base)));")
Call rti.addnewline(1)
End If
i% = i% + 1
End Forall
Call newdoc.send(True)
End Sub
Tthe people receive that:
serveur:=“CCD_NOTES”;
base:=“Acces.nsf”;
temp := @DbExists(serveur:base);
@If(temp = @False; @Return(“”);
@Do(@Command([WindowWorkspace]);
@Command([AddDatabase]; serveur:base)));
serveur:=“CCD_NOTES_SERVICES”;
base:=“Applications/soutieni.nsf”;
temp := @DbExists(serveur:base);
@If(temp = @False; @Return(“”);
@Do(@Command([WindowWorkspace]);
@Command([AddDatabase]; serveur:base)));
serveur:=“CCD_NOTES”;
base:=“Applications/Mouvement1.nsf”;
temp := @DbExists(serveur:base);
@If(temp = @False; @Return(“”);
@Do(@Command([WindowWorkspace]);
@Command([AddDatabase]; serveur:base)));
serveur:=“CCD_NOTES”;
base:=“Impersonnelle/adfsb.nsf”;
temp := @DbExists(serveur:base);
@If(temp = @False; @Return(“”);
@Do(@Command([WindowWorkspace]);
@Command([AddDatabase]; serveur:base)));
So, i would like that the people receive button with this last code and not the code.
I hope it’s more clear.
Estelle