Objects must tell all other programs what is supported
Properties
Methods
Objects
Consistent, programmatic access to functionality
What is OLE?
Object Linking and Embedding
Another Microsoft standard
Allows one application document to include a portion of another application
A Word document with an Excel spreadsheet inside
OLE/1 — attachments
OLE/2 — linking or embedding
Integration from Notes
From Notes, you will write code to manipulate the application
You can integrate pretty much with anything
In most cases, you will be converting Visual Basic for Applications (VBA) code to LotusScript
The VBA code will be written so it saves in Notes as LotusScript
Once you get the knack of converting the code, you can focus on the process vs. the code
Creating a Word Document
Create an instance of the application object
All applications that support COM have object names
To find the object name:
Review the application documentation
Look it up in the Windows registry
Never use version-specific application object names
Good: Word.application
Bad: Word.application.11
When the application upgrades, you must modify your code
Variant Application Object Name LotusScript Method Set hwd = CreateObject("Word.Application")
Creating a Word Document (cont.)
You must follow the application’s object model:
Word.application
Documents
Document
Paragraph
Bookmark
CustomDocumentProperties
If accessing the current open document, use:
Application.ActiveDocument
Application.ActiveWorkbook
Application.ActivePresentation
etc.
All applications have an object map in help
The Easiest Way to Start
Microsoft Office provides us with a recorder
Records all keyboard actions
Mouse actions are sometimes recorded, so avoid when possible
Generates VBA code for you
Easy way to learn how something is done
Table is created
Page settings are set
etc.
What’s up with the Recorded Syntax?
This is the recorded syntax:
Saving LotusScript with wdToggle and wdAlignParagraphCenter fails!
Need to replace VBA constants with raw values
Write a macro
Msgbox [constantname]
Or …
Selection.TypeText Text:="this is new text" Selection.TypeParagraph Selection.TypeParagraph Selection.Font.Bold = wdToggle Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeText Text:="this is more text"
Creating a Word Document — “Hello World” Demo — Example 1 Launch Microsoft Word and enter some text
Merging Mail from Notes
Most requested Notes-to-Office Integration functionality
Users have no idea how to get data from Notes into Word
Lotus has not provided this functionality … yet
Quick win for you — take this code back and add it to your boss’s personal name and address book and be the HERO!
Mail Merge in Different Versions of Word
Mail merge is version-specific
One version for Word 2000 and before
One version for Word XP
One version for Word 2003
Minor change on closing documents in 2003
New version for Word 2007
Use the Mail Merge Wizard to Your Advantage
The Mail Merge Wizard has six steps
1. Select document type
2. Select starting document
3. Select recipients
4. Write your letter
5. Preview your letters
6. Complete the merge
You can control which:
Wizard steps display
Step to start on
Mail Merge from Address Book Demo — Example 2 Generate a mail merge from the personal name and address book
Moving to the Other Side
This part covers the more advanced subjects
Such as automating Lotus Notes from Microsoft Office and other technologies
We will use COM, XML, Web services, and .NET technologies
Things we CAN do …
Microsoft Word and Web services
Microsoft Excel and XML
Microsoft InfoPath and Web services
.NET and Lotus Notes/Domino
Visual Studio tools for Office
Automation from the Microsoft Side
Many integration scenarios require that user interaction start, or solely be, from an application other than Notes
Many times we will not have the Notes client installed
We will not be writing LotusScript
We may call LotusScript through the Notes COM interface
We need to take advantage of “new” technologies
XML
Web services
.NET
Managed code
Domino COM Basics
Working with the Domino Objects is almost the same as writing code in Notes!
Only supports back-end objects
No NotesUIDocument, NotesUIView, NotesUIWorkspace, etc.
COM support was added in Notes 5.0.2b
Updated in 6.5.1 to support 6.X
ND7, 8 & 8.5 – COM support out of the box
COM interface is the same as LotusScript, with some minor exceptions
Registering the Notes COM Objects
Sometimes Notes does not register itself properly with the Windows registry
Sessionid and fieldName are values we pass into the Web service
The return value comes back as string
Ways to Add Domino Functionality to ASP.NET
Using Notes/Domino’s COM interface
Using Domino Web services
Using Domino Web agents and XML
NOTE: Selecting the right option is dependent on the Domino Server version and the developer’s skill
Domino COM in ASP
From within Visual Studio .NET, using the ASP.NET template
Add the Domino COM reference like we have done in Office and VSTO
Build the ASP.NET page
Building the ASP.NET Page
Add the standard fields and labels to the ASP page
The COM code is behind the button
ASP.NET Calling a Domino Web Service
We will call a Domino Web service
ASP.NET will import the Web service
ASP.NET Calling Domino via a Web Service Demo — Example 4 Creating an ASP.NET Web page that calls Domino via a Web service
Integra4Notes and Integra Quick Reports
Integra4Notes
A Notes application that allows importing and exporting of data between Lotus Notes and Word, Excel, PDF files, and XML files
The premier reporting framework for Notes developers
Integra Quick Reports
Ad hoc reporting for end users to Microsoft Excel
Mail merge and labels to Microsoft Word
From any Lotus Notes database
Integra4Notes Key Features and Benefits
More advanced capabilities
Event-driven script, for example
Access multiple databases and sources
Oracle, SAP, mySQL, etc.
Non-intrusive — no designer changes
Zero footprint — no EXE, no DLLs, etc.
Distribute via email, save to Notes document, send doclinks, send to printer, fax, etc.
Notes client, browser, and scheduled
Export and import
Generate PDFs
4.5 ships with print driver – no extra cost
Third-Party Application Demonstration Demo — Example 5 Integra4Notes and Integra Quick Report samples
Integra for Notes Personal Edition
Provides the user with integration for their Contacts to do the following:
Mail Merge
Labels
Mass Email
Export to Excel
Ad-hoc export to Excel with Pivot Tables and Charting
Supports Notes 6.5, 7, 8, & 8.5
Supports Office 97 thru 2007
www.integra4notes.com/personal FREE!!!!
Lotus Symphony – The Developer Perspective
Symphony has multiple methods for customization
UNO API
Symphony Plug-ins
Composite Applications
Introduction to OpenOffice.org development
Designed on an interface-based component model called Universal Network Objects (UNO)
UNO definition
UNO offers interoperability between different programming languages, different object models, different machine architectures, and different processes; either in a local network or even via the Internet
UNO components can be implemented in, and accessed from, any programming language for which a UNO language binding exists
Does this work with Lotus Symphony?
The demo will be done using Lotus Symphony
You will need Notes 8.0.1 or higher
IBM has exposed the Lotus Symphony objects to the registry to allow COM to work
If you want run the demos in 8.0.0, they will invoke OpenOffice.org
What is the ServiceManager?
ServiceManager is similar to the NotesSession class
It is a factory class that gets you to other places
Set SM=CreateObject("com.sun.star.ServiceManager")
Think of the ServiceManager as a back-end class, and we want the front end (like NotesUIWorkspace)
Set Desktop=SM.createInstance("com.sun.star.frame.Desktop")
What Did That Do?
Calling the ServiceManager created an OpenOffice.org window, but we need to do more …
Let’s Start Writer — Word Processing Application
So far we have an OpenOffice.Org window, but it doesn’t know what application it will be — we have to tell it
Dim args()
Set WriterApplication=Desktop.loadComponentFromURL ("private:factory/swriter","_blank",0,args)
Args is a variant array
We don’t want to pass any parameters, but it must be an array
The “s” in “swriter” stands for “Star”
Now we have a word processor up and running
The Picture So Far
Now we have an application open
Time to do something!
Let’s Add Some Text
First, we need to get a handle to the text part of the document
Set WriterText=WriterApplication.getText()
Next, we need a cursor position where we can insert the text
0 comments
Post a comment