Create button in lotus script

Hi!

Does someone know how to add a button in a new document to send with lotus script?

In lotus script, i create a new document to send, i want to put a button with some formula code. And the user who receive the document(email), click on the button and it does the code.

Estelle

Subject: Create button in lotus script

if I understand correctly, you want to programmatically add a button to a newly created document on the fly? If so you could place the button in a rich text field on a “profile” document then get a handle to that rich text field and copy it or it’s contents to the document you are working on. Or you could create a custom form with the button already on it and enable “store form in document” property.

Subject: RE: Create button in lotus script

Yes but the problem is the formula code allways change. So i don’t know if i can change the button on the profile document before i take this button.

In the action buttton, in lotus script,i create a new document(email), in this document, i create a body rich text field and i want to create a button in this field and write in this button a formula code. This formula code change each time.

Estelle

Subject: RE: Create button in lotus script

Does the code (that is, the logic) really change or is it just literals (strings, numbers, etc) inside the formula that the code operates on. If the button is being executed on a mail message, it will have access to items set on that document. So you can set some items to the variable values before sending the email and then simply refer to the fields in your standard formula code.

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