Download - Bp205
®
BP205 - The Integration Revolution: Microsoft Office 2007 with IBM Lotus Notes and Domino
John D. Head
Before we begin …
Please turn off/set to vibrate/mute allCell PhonesPagersComputers
Please remember to fill out your evaluations
Who is John D. Head?Who is John D. Head?
Offering and Development Manager for frameworks at PSC Group, LLC
Involved in Lotus technology since 1993
Speaker for over 20 sessions at Lotusphere since 1996
Speaker at Advisor conferences
IBM Lotus Notes/Domino Certified
Author for Advisor Magazine and other publications on Office and SmartSuite integration with Notes
LotusUserGroup.org contributing Author and Forum moderator
Blog with articles www.johndavidhead.com
PSC Group, LLC
IBM Premium Business Partnerfor 15+ Years
Microsoft Gold Partner
Winner 2007 Lotus Award
Notes 8 Design Partner
Host of OpenNTF.org
Host of the following blogs:Mike Rhodin – Lotus GM
(www.mikerhodin.com)Ed Brill’s
(www.edbrill.com)Alan Lepofsky’s Notes Tip’s
(www.alanlepofsky.net)Alan Gartenberg - Sametime
(www.adamgartenberg.com)Jeff Eisen – Hannover
(www.jeffeisen.com)Domino Server Team
(www.dominoblog.com)Chris Pepin – IBM CTO’s Office
(www.chrispepin.com)
www.PSCListens.com
Purpose
Present new ways to integrate
Utilize new features in Visual Studio.NET 2005 and Visual Studio Tools for Office (including VSTO SE)
Take advantage of Notes & Domino 7 functionality
Discuss the impact of Notes & Domino 8 on Office Integration
Demonstrate some of the possibilities
A word of warning …
Expect lots of Code !!!
This session starts out basic … and then gets advanced very fast!
If you have never programmed LotusScript of VBA …
Updated Jumpstart from 2006 for Office 2007
A little poll
Who is using … Office 97 and earlier Office 2000 Office XP Office 2003 Office 2007 OpenOffice.org / StarOffice Office for the Mac Microsoft Works iWorks or Appleworks SmartSuite Other
Before I continue …
IBM has given me permission to demonstrate Notes 8
PSC is a Lotus Notes and Domino 8 Design Partner
The build I am showing is about 3 weeks old
Public Beta is coming very soon (1Q 2007)
Please bear with me if we see any crashes
Agenda Getting Started
EXAMPLE 1 – Word and Lotus Notes “Hello World”
EXAMPLE 2 – Word 2007 Demo
EXAMPLE 3 – Mail Merge
EXAMPLE 4 – Working with Excel
EXAMPLE 5 – Working with PowerPoint
EXAMPLE 6 – Working with Project
Web Services
EXAMPLE 7 – Word and Web Services
EXAMPLE 8 – InfoPath
EXAMPLE 9 – Office Template Installation
XML, ODF, and OOXML
EXAMPLE 10 – Using XML with Excel
EXAMPLE 11 – VSTO
Question and Answers
The Demo Databases
BP205 Example Database Single database with all examples You can configure it for your Notes client Example Numbers in the Presentation
match to those in the database
Lotusphere 2007 Session Database Developed By Genii Software You can download and schedule your LS
2007 experience from http://www.geniisoft.com/showcase.nsf/LS2007_SessionsDB
I have added some design elements for this session
Personal Name and Address Book My demos work with the standard Notes 7
and 8 templates
Integration History 1994
DDE with Ami Pro
1996 Notes R4 OLE LotusScript VBA
1997 SmartSuite with LotusScript (Word Pro)
1998 Notes R5 with COM support
2001 Notes Domino 6
2004 Notes Domino 6.5 with LS2J and DXL
2005 Notes Domino 7 with web services
2007 2007 Office System Lotus Notes/Domino 8
The Good News
We are at the end Renaissance of the Integration Era
Via Revolution!
In the “Medieval Times” DDE with Ami Pro NotesSQL was used to get even the basic of data OLE Embedding Notes F/X
The Renaissance brought us new tools Visual Studio.Net Visual Studio Tools for Office XML Web Services
The Revolution blurs the lines …
Integration in 2007
Proprietary Technologies are being replaced Moving to standards-based Document formats that are “open” Web Services
No Longer limited to OLE and COM
Integration without needing local data Notes Client not required
XML is the foundation
Web Services allow for new types of applications
Integration in 2007 (cont)
New applications and tools
Difficulty scale increasing drastically
Limitations being removed Speed Data Size Presentation Options
Integration should always focus on the end user!
Integration from Notes
From Notes, we will write application code to manipulate the application
This application code will be modified so it saves in Notes
In most cases, you will be converting Visual Basic for Applications (VBA) code to LotusScript
EXAMPLE 1
Creating a Word Document – “Hello World”
Launch Microsoft Word
Enter some text
Creating a Word Document
Must create an instance of the application object first
All applications that support COM have object names
Finding the object name … Application Documentation Registry
Never use version specific application object names Good – Word.application Bad – Word.application.11 When the application upgrades, you have to modify your code
Set hwd = CreateObject("Word.Application")
Creating a Word Document
Must follow the applications 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 a Object Map in Help
What’s up with the recorded syntax?
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“
Saving LotusScript with wdToggle and wdAlignParagraphCenter fails!
Need to replace VBA constants with raw values Write a macro
Msgbox [constantname]
Microsoft Constants Database
Provides a listing of all Microsoft Office Variables and their converted constants
Extraction of Constants by John Collidge
Database built by Tom Duff
Now an OpenNTF.org project
Supports Microsoft Office 2000, XP, 2003, and 2007
More features planned!
EXAMPLE 2
Word 2007 Demo
Create a new document
Prompt User to select something
Place data into document
Let’s look see the demo
Demo database is the “Lotusphere Sessions” database – used for most of the demos Available for download
EXAMPLE 3
Mail Merge from Address Book
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 back and add it to your boss’ Personal Name and Address
Book and be the HERO!
Mail Merge
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
Sample of Office 2007 Mail Merge
Mail Merge - Details
Let’s look at the code
Mail Merge object allows for user interaction
Select what pieces of the Mail Merge Wizard the user sees
Interaction is your choice!
EXAMPLE 4
Working with Microsoft Excel
Build an Excel spreadsheet with data from Notes
Use Excel Charting functionality
Let’s see the demo
Let’s see the code
EXAMPLE 5
Working with PowerPoint
Once you learn how to move data to the application, all you have to do is learn the object model for that application
Demo from Personal Address Book
Demo from Sessions Database
EXAMPLE 6
Working with Project
Microsoft Project’s COM API is the ‘hardest’ of all the Office Applications
Syntax is very different
Demo from Tasks in Notes Mail File
Demo of Export with Session Database
Limitations with traditional methods
Notes Client must be installed
Must have understanding of Notes Object Model Notes Storage Model
Can be slow with large amounts of data
Web Services
Self-contained application published and invoked from web
Based on XML
Uses WSDL and SOAP
Designed for machine-to-machine interaction
Advantages Connects various applications running on different platforms Use open standards and protocols Use HTTP bypassing firewall and other security measures
Disadvantages Poor performance as opposed to DCOM
First things first
First, you need to build a Web Service
They can be written using LotusScript, Java or importing WSDL
They are very similar to an agent
To be able to write a web service, you must know how to write a Class
Web Service Classes
Example of a simple class
Class GetPersonInfo
Sub New
End Sub
Public Function GetEmailAddress(personname As String) As String
End Function
Public Function GetPhoneNumber(personname As String) As String
End Function
End Class
Lotusphere Sessions Web Service
EXAMPLE 7
Word 2007 Demo – Web Services
Create a new document
Prompt User to select something
Place data into document
Let’s look see the demo
•Same demo as the Word 2007 COM demo
•Different Technology
•Get to the same place with different technique
•Remember, it is not how you build it, but how the user experiences it
EXAMPLE 8
InfoPath
Using the Sessions database
Uses a Web Service
Stand-alone application
Let’s look at the demo and code
This demo uses data and techniques from InteropTips.com
EXAMPLE 9
Office Templates
How did I get that template in my New dialog?
Template Installation Tool Each template is a document Supports all Office 2000 thru 2007 applications
Can also be used as a programmatic template tool
Located on OpenNTF.org
Let’s see the demo
Office 2007 and XML
Office 2007 XML is a now a Standard Open XML
Many documents can be stored as XML Options to save only data
Import data from XML file
Specific/Import XML Schema
Transform XML with XML Style Sheets
How Domino Data looks as XML
EXAMPLE 10
Using XML with Excel
Read XML from a Notes Database
XML generated via Agent in Notes Database
Chart the data using Excel charting tools
Works with Domino 5.X, 6.X, 6.5.X, 7, and 8
Visual Studio.NET
Microsoft Development Environment
Supports Multiple Languages VB.NET C# Etc
Support for WinForms
Uses .NET Security
Visual Studio Tools for Office
Addin for Visual Studio.NET
Adds support for Word Excel InfoPath Outlook
Can develop in Visual Basic C#
VSTO Second Edition adds Application Add-ins for Office 2007
EXAMPLE 11
Word 2007 Demo with VSTO
Same demo as the Word 2007 Web Services demo
Build in VS.Net using VSTO
Get to the same place with different technologies
Remember, it is not how you build it, but how the user experiences it
Office 2007 Introduces Much More
Notes/Domino 7 brought web services into our world
Notes/Domino 8 will make web services ‘normal’ in our applications Web Service Consumption
Integration will allow the end user to determine which application they live in
The Future
At Lotusphere2007
In the Product Showcase PSC Group, LLC – booth 277
Integra for Notes – booth 610
Wrap-up
Demonstrated multiple technology paths to reach the same goal
Discussed COM/OLE, Web Services, and XML
Walked thru lots of examples
Hopefully gave you ideas on how to add value to your applications
Resources
MSDN
http://msdn.microsoft.com
InteropTips.com
http://interoptips.com
John Head’s blog
http://www.johndavidhead.com
Slides and content available from
http://www.psclistens.com
Thank you!Thank you!
Questions & Answers
Please remember to fill out your evaluation.Please remember to fill out your evaluation.
www.johndavidhead.com www.psclistens.com