358 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Jobs | Twitter | Bookmarks | Pods | Forum | Blogs | Search | myPL | About 
 
Latest 7 Posts
New Media Tuesday - 8/31/2010
Tue, Aug 31st 2010 34
Happy 20th Birthday to PSC!
Fri, Aug 27th 2010 44
New Media Tuesday - 8/24/2010
Tue, Aug 24th 2010 29
MWLUG 2010 - Thoughts
Mon, Aug 23rd 2010 70
MWLUG 2010 - “Kum Bah Yah” meets “Lets Kick Butt” : The Integration of IBM Lotus Notes and Domino with Microsoft Office, .NET, and IBM Lotus Symphony
Fri, Aug 20th 2010 60
New Media Tuesday - 8/17/2010
Tue, Aug 17th 2010 45
LotusLive Notes - Why this is just the tip of the iceberg
Mon, Aug 16th 2010 199
Top 10
New Media Tuesday - 6/1/2010
Tue, Jun 1st 2010 1036
HTML5 Presentation - This is why IBM is so hot about using HTML 5 for Project Vulcan
Mon, Apr 19th 2010 592
If IBM Project Vulcan succeeds, the IBM Lotus Notes Client we know today is dead
Tue, Apr 13th 2010 534
8.5.2 Finally Makes Database Icon’s Rock
Mon, Apr 19th 2010 483
HTML5 Follow on thought ... and how it applies to Notes SQL
Tue, Apr 20th 2010 279
Notes and Outlook Speed Tests Redux - Measuring the Lenovo T410s
Tue, May 11th 2010 268
OpenNTF Contacts Experience 8.5.1 V1 is available for download!
Tue, Apr 13th 2010 263
OpenNTF Contacts Experience Version 1.0 is coming ... and here is some proof!
Mon, Apr 12th 2010 256
Lotusphere 2010 : More Details about Lotus Symphony 3.0
Mon, Feb 1st 2010 243
LotusLive Notes - Why this is just the tip of the iceberg
Mon, Aug 16th 2010 199


Lotus Symphony Documents "Hello World" in LotusScript
John Head    

To get started with the Lotus Symphony LotusScript API, let's write our first code sample - the ever popular "Hello World" sample.

To start, create a new button in a Rich Text field in a document. Change the code selection drop-down to "LotusScript" and enter the (Options) section. To begin, every time you want to use the Lotus Symphony LotusScript API, you need to call the LSX. You do that with the following code:

       %INCLUDE "symphonylsx.lss"

This tells LotusScript to load the Symphony LSX. It also enables LotusScript to do cool things like provide type-ahead for the custom LSX - even in buttons or in actions on a form or view.

Image:Lotus Symphony Documents "Hello World" in LotusScript

Now let's write some code. Go into the Click section of the button and enter the following:

       Dim application As SymphonyApplication    
       Set application = New SymphonyApplication

To begin, we are creating an application variable and setting it to the SymphonyApplication class. We then set that variable to a new instance of that class. So how did I know what the object model for the API is? In that Toolkit download that I talked about in my last blog, if you go into the lsxapidoc folder, open the Index.html file. Click the Document API Link.

Image:Lotus Symphony Documents "Hello World" in LotusScript

This gives you a complete roadmap for the Symphony LotusScript API for Documents. You can click on each class to get all of the properties, methods, and description of each class and some samples.

We are starting with SymphonyApplication. Think of this like the NotesSession class. You will call this class no matter which of the three Symphony applications you are using. You will not see anything on screen at this point. Symphony has loaded into memory. Next, we call the SymphonyDocuments class

       Dim documents As SymphonyDocuments
       Set documents = application.Documents  
       
We are defining and setting an instance of a class that defines the Symphony Application type. At this point, you will see Lotus Symphony load on your screen. Next, we set up a single document instance to work with:

       Dim document As SymphonyDocument
       Set document =  documents.AddDocument("",True,True)

Here, we have told Symphony to load a blank new document. The AddDocument method has the following properties:

Set
document = documents.AddDocument(Template, AsTemplate, Visible)

Since we are not using a template, we leave the first parameter blank. And since there is no template, you must set the AsTemplate property to False. The documentation will tell you that you can use True or False here when Template is blank, but trust me - use False. Otherwise you will crash Notes. I know by experience!. We are also setting Visible to true. This will display the blank new document within Lotus Symphony Documents in your Notes client. We then need to setup a range to work with:

       Dim range As SymphonyTextRange
       Set range = document.content.End

If you are not working with a named object, like a bookmark or table cell, you have to work with a range. Since this is a blank document, the easiest range to work with is the entire document. So after defining our range variable, we set the range to the entire document contents using the document.content.End property. There is nothing in the document, so this is really just getting the cursor location, but it will work for our purpose. Last, we enter some text:
       
       Call range.InsertBefore("Hello World")

Using the range.InsertBefore method, we enter our "Hello World" text. Here is the code in a copy and paste format:

%INCLUDE "symphonylsx.lss"

Dim application As SymphonyApplication    
Dim documents As SymphonyDocuments
Dim document As SymphonyDocument
Dim range As SymphonyTextRange
       
Set application = New SymphonyApplication
Set documents = application.Documents  
Set document =  documents.AddDocument("",True,True)
Set range = document.content.End
       
Call range.InsertBefore("Hello World")

Once you exit the button, save the Notes document, change to Edit mode; click the button. You should see this:

Image:Lotus Symphony Documents "Hello World" in LotusScript

You might have noticed that Symphony took a bit to load up. Leave the Symphony Document open and go back to the button. Click it again. You will notice that it is quite a bit faster. Symphony caches after the first load - and also uses a start-up procedure to speed itself up. In preference, you can set if this should load at startup. You can see that option here:

Image:Lotus Symphony Documents "Hello World" in LotusScript

If you click that, you will notice a process called soffice.exe loads at Windows startup. Here is a view of that from Windows Task Manager:

Image:Lotus Symphony Documents "Hello World" in LotusScript

If you disable that, the first time load will be significantly longer than without the startup pre-load. If you use Symphony regularly, I recommend you turn this on.

There you go - your first piece of Lotus Symphony LotusScript API code written!

---------------------
http://www.johndavidhead.com/jhead/johnhead.nsf/dx/lotus-symphony-documents-hello-world-in-lotusscript-
Oct 21, 2009
145 hits



Recent Blog Posts
34


New Media Tuesday - 8/31/2010
Tue, Aug 31st 2010 12:30p   John Head
Here is what's coming out today ... Movies Beatdown Best Of Soul Train Brainjacked Brothers & Sisters: Season #4 Ca$h Cemetery Junction Final Girl FlashForward: The Complete Series Forbidden Dreams Harry Brown House: Season #6 Lonesome Dove: The Series: Season #1 Marmaduke Middle, The: Season #1 NCIS: Los Angeles: Season #1 Naked Cities One Tree Hill: Season #7 Parenthood: Season #1 Persons Unknown: Season #1 Sexy Radio Sons Of Anarchy: Season #2 Thriller: The Complete Series (#18 in [read] Keywords: vista wireless
44


Happy 20th Birthday to PSC!
Fri, Aug 27th 2010 10:20a   John D Head
Tomorrow, August 28th, marks the 20th birthday of PSC Group. The founders, Andrew Lauter and Bruce Bellak started the company out of a desire to do provide superior service and great technology consulting to their customers. I have personally been with PSC for 10 years and am proud to be part of this great company. And at 10 years, I am in the middle of the pack in terms of seniority ... we have one member of the team that has been here for 19 years and another for 18! Pretty incredible [read] Keywords: consulting
29


New Media Tuesday - 8/24/2010
Tue, Aug 24th 2010 12:30p   John Head
Here is what's coming out today ... Movies 90210: Season #2 Ax Men: Season #3 Black Orpheus: 2 Disc Edition: The Criterion Collection Days That Shook The World: The Complete Series Dexter: Season #4 (Blu-Ray) (#15 in the DVDPS Top 40) Dexter: Season #4 (#6 in the DVDPS Top 40) First Four Films Of Akira Kurosawa, The: Eclipse From The Criterion Collection Flight Of The Conchords: The Complete Collection Gangland: Season #5 Gossip Girl: Season #3 Jim Henson's Dinosaur Train: Dinosaurs Under [read] Keywords: symphony eclipse vista
70


MWLUG 2010 - Thoughts
Mon, Aug 23rd 2010 5:50p   John D Head
Last week, in Cleveland, Ohio, the second MWLUG took place. MWLUG 2010 was bigger and better than the first last year. Here are some thoughts on the conference: 1. The conference really came into it's own this year. As much as I liked being in Chicago last year - and being at the IBM Innovation Center - being a hotel in another city took MWLUG to it's user group roots. It felt like a user group conference - not something IBM ran. This was a good thing. 2. The attitude of the user group menta [read] Keywords: connections ibm lotusphere community networking
60


MWLUG 2010 - “Kum Bah Yah” meets “Lets Kick Butt” : The Integration of IBM Lotus Notes and Domino with Microsoft Office, .NET, and IBM Lotus Symphony
Fri, Aug 20th 2010 2:10p   John D Head
MWLUG 2010 - “Kum Bah Yah” meets “Lets Kick Butt” : The Integration of IBM Lotus Notes and Domino with Microsoft Office, .NET, and IBM Lotus SymphonyView more presentations from John Head. Download the PSC Integration Samples database here. The OpenNTF.org Contacts Experience project is located here. [read] Keywords: domino ibm lotus notes symphony application database integration microsoft office openntf
45


New Media Tuesday - 8/17/2010
Tue, Aug 17th 2010 10:20a   John Head
Here is what's coming out today ... Movies Black Orpheus: 2 Disc Edition: The Criterion Collection Ca$h Cemetery Junction Cougar Town: Season #1d Dark Oracle: The Complete Series Dexter: Season #4 (#8 in the DVDPS Top 40) Friday Night Lights: Season #4 Keeping Up With The Kardashians: Season #3 L'Enfance Nue: The Criterion Collection Last Song, The Max Headroom: The Complete Series (#3 in the DVDPS Top 40) One Tree Hill: Season #7 Orlando: SE Red Shoes, The: 2-Disc Edition: Criterion Coll [read] Keywords: mac oracle vista wireless




199


LotusLive Notes - Why this is just the tip of the iceberg
Mon, Aug 16th 2010 12:14p   John D Head
Last week, IBM announced LotusLive Notes, the cloud (hosted) version of IBM Notes & Domino. I didn't have time to blog about it last week, so here is a reply of what took place. First, Ed announced LotusLive Notes. You can also read the IBM press release for IBM LotusLive Notes and IBM Lotus Notes & Domino 8.5.2. Both are coming August 24th, 2010. Then, reporting from a blogger conference call, Tom, Peter, John Roling, and Nathan wrote their thoughts and impressions - and some questio [read] Keywords: domino ibm lotus lotusphere notes notes client ntf quickr sametime symphony application applications bleedyellow bleedyellow.com blogger community email google integration microsoft oracle server sharepoint
80


PSC built BarillaUS.com featured on topsharepoint.com
Mon, Aug 16th 2010 10:10a   John D Head
PSC's Microsoft practice has gotten a great accolade: the Barilla website (www.barillaus.com) has been featured on topsharepoint.com Congratulations to the team at PSC for developing such a great site and being selected for topsharepoint.com! [read] Keywords: microsoft
40


New Media Tuesday - 8/10/2010
Wed, Aug 11th 2010 7:00a   John Head
Here is what's coming out today ... Movies 187: One Eight Seven Adam-12: Season #5 Casper's Scare School: Season #1 Crumb: The Criterion Collection Date Night Joneses Louie Bluie: The Criterion Collection Max Headroom: The Complete Series (#2 in the DVDPS Top 40) Mercy: Season #1 Minder: Season 3 Numb3rs: Season #6 Titan Maximum: Season #1 Trauma: Season #1 UFC 114: Rampage Vs. Evans: Ultimate 2 Disc Edition Computer Games Madden NFL 11 ( Xbox 360) Tritton AX Pro Dolby Digital Precis [read] Keywords: vista
113


Yellow Day Release: Updated OpenNTF.org Contacts Experience
Wed, Aug 11th 2010 6:50a   John D Head
In honor of Yellow Day, I am going to post a new version of the OpenNTF.org Contacts Experience. Here is what is new: - Support for Microsoft Office 2010 - Updates to Microsoft Office Label and Envelope Functionality - Started work on adding Label functionality - The beginnings of custom field functionality: The goal is to have custom templates that the user can select, but first we need custom fields. The first release just defines the basic fields and a way to customize them. More to com [read] Keywords: notes symphony microsoft office openntf




Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - FAQ - Mobile Edition