Avatar of usachrisk1983
usachrisk1983
Flag 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.

Thanks!
Lotus IBM

Avatar of undefined
Last Comment
p_partha

8/22/2022 - Mon
SysExpert

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 !
SysExpert

ASKER CERTIFIED SOLUTION
p_partha

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Sjef Bosman

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?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
usachrisk1983

ASKER
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.
Sjef Bosman

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?
usachrisk1983

ASKER
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.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Sjef Bosman

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.
usachrisk1983

ASKER
Unfortunately I'm not a Lotus developer, nor do I have access to create databases or modify the design of any.
Sjef Bosman

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.
Your help has saved me hundreds of hours of internet surfing.
fblack61
usachrisk1983

ASKER
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!
SysExpert

A good automation tool I use is the free
Auto-it

see
http://www.autoitscript.com/autoit3/

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 !

usachrisk1983

ASKER
Hello, I've used AutoIT a number of time, and it is quite helpful, but not exactly what I'm looking for, thanks!
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
usachrisk1983

ASKER
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?
usachrisk1983

ASKER
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...
usachrisk1983

ASKER
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 stream.open("c:\temp\scriptDoc.dxl") Then
            Msgbox "Cannot open DXL."
            Exit Sub
      End If
      
      Dim importer As NotesDXLImporter
      
      Set importer = session.CreateDXLImporter(stream,db)      
      importer.process
      
      Exit Sub
      
errhand:
      Msgbox "error at line " & Erl & ": " & Error
      Exit Sub
End Sub
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
p_partha

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

partha
usachrisk1983

ASKER
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>
p_partha

You have misspelled stream in the variable name, that could also be a problem.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
usachrisk1983

ASKER
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.  :)
p_partha

Thanks for the points :))

-Partha