Link to home
Start Free TrialLog in
Avatar of usachrisk1983
usachrisk1983Flag for United States of America

asked on

Script to Create Lotus Notes Button

I am looking for a way to script the creation of a Lotus Notes button - and if possible, from outside of Lotus Notes.  Ideally, I'd like something where I enter a few parameters, and it creates a button for me with the Lotus Script template I have inside.  I am familiar with VB.NET, VBS, and most other popular languages, just don't know how to generate something that I can either have put in Notes, or that I can copy & paste into a Notes document to do the work.

Avatar of SysExpert
Flag of Israel image

I am not sure if this is what you want, but you can put buttons in a document in a Notes DB r a template, and then send or copy these to other locations, preprogrammed.

It may be possible to create a button via COM, but you would need to check the API interface.

I hope this helps !
Avatar of p_partha

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Partha, Bro! I hope calling these DXL-methods require Designer privilege. Must be... disaster lurking around the corner!

By the way, did you try with HTML in a richtext field? Where do you want that button? On a form? Or in a document?
Avatar of usachrisk1983


p_partha -> I'm looking to create just the button, not a form.

SysExpert -> That's what I do now, copy & paste from another document and then change the code inside.  I will check the API link you've submitted.

Bosman -> I'm looking to create the button in a document.
What will be the code executed by the button? Is it possible to make a standard button, and modify or parametrize the code that it executes?
The full story is that the buttons run EXECUTE to run an installation.  The path, destination, and label vary, but the servers are pretty static by site.  So let's say I have 30 servers, I'm trying to script myself a solution where I put in the label I want for the button, the path, and the exe (as well as any parameters), and my script would create the buttons for me.

Currently, I would create one, get it all nice & pretty, then copy & paste it a certain number of times, and modify each one.
May I suggest you create one standard button, that acivates one agent? Develop a database where the button retrieves the information from, so the agent can get the info from that database. No tricky coding, simple approach, easily adapted, boss happy.
Unfortunately I'm not a Lotus developer, nor do I have access to create databases or modify the design of any.
Ah... :-$

AFAIK there's no (easy) way to program a button in a Notes document without a Domino Designer. The least you would need is a Notes form with a standard button and some fields, those you could set from VB using the COM interface. Is the installation to be done with a .BAT file or so? That can be activated from Notes as well, when the user clicks the button.

Sorry I can't help you any further.
The installation is an EXE.  I've been making these buttons for years, but as the company expands and more servers come up, there are more and more buttons to create.  Since I'm a packager, automation is my life - so I want the creation of the buttons for the packages I've creating to be automated as well.  I can create the buttons manually, and use EXECUTE with the path & params - just want to do it automagically.  

You've helped plenty, I still have links to review and some other info that you've all told me about -- I'll get back to this starting Tuesday, have a good weekend everyone!
A good automation tool I use is the free


It also has a recorder available.
COmpiles to small EXE files or use live.

This might also help change buttones via script, using files for importing the Execute portion of the program name.

I hope this helps !

Hello, I've used AutoIT a number of time, and it is quite helpful, but not exactly what I'm looking for, thanks!
Ok, so I've gotten my hands on Domino designer, and I can create a local database -- which is a fine staging area, any pointers on how to get it to autogenerate a button to my liking?
Update - I've gotten an agent built, and it exports the DML.  I've got the code for the button, and now I want to import it.  I'm trying it on my own, but will keep checking here for help...
Here's what I've tried, but I'm getting errors about the DXLImporter being uninitialized or improperly typed.

Sub Initialize
'      On Error Goto errhand
      Dim w As New notesuiworkspace
      Dim doc As notesdocument
      Dim db As NotesDatabase
      Dim filename As String
      Dim session As New NotesSession
      Dim dml As String
      Dim strem As NotesStream
      Set db = w.CurrentDatabase.database
      Set doc = w.currentdocument.document
      Set stream = session.CreateStream
      REM Open xml file
'      filename$ = "c:\temp\scriptDoc.dxl"
'      If Not stream.Open(filename$) Then
'            Messagebox "Cannot open " & filename$,, "Error"
'            Exit Sub
'      End If
'      Call stream.Truncate
REM Export current document as DXL
'      Dim exporter As NotesDXLExporter
'      Set exporter = session.CreateDXLExporter
'      Call exporter.SetInput(doc)
'      Call exporter.SetOutput(stream)
      If Not"c:\temp\scriptDoc.dxl") Then
            Msgbox "Cannot open DXL."
            Exit Sub
      End If
      Dim importer As NotesDXLImporter
      Set importer = session.CreateDXLImporter(stream,db)      
      Exit Sub
      Msgbox "error at line " & Erl & ": " & Error
      Exit Sub
End Sub
Avatar of p_partha

Make sure that the stream text doesn't have any special characters like <,>,'," which may bomb in XML

It does, how to I escape it?

Here is the DML I'm trying:

<button width='2.8854in' widthtype='maximum' wraptext='true' bgcolor='system'><code event='click'><formula>@Command([Execute]; '\\\\SWSHARE\\SOMEFOLDER\\AA405inst.EXE')</formula></code><font size='12pt' style='bold' color='#2222c0'/>Adobe Acrobat 4.05</button>
You have misspelled stream in the variable name, that could also be a problem.
Thanks, that does it!  Or at least gives me plenty to play with.  Much appreciated and I think this will help others that come to EE.  :)
Thanks for the points :))