Jmp108
Upcoming SlideShare
Loading in...5
×
 

Jmp108

on

  • 929 views

 

Statistics

Views

Total Views
929
Views on SlideShare
927
Embed Views
2

Actions

Likes
0
Downloads
12
Comments
0

1 Embed 2

http://www.slideshare.net 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Jmp108 Jmp108 Presentation Transcript

    • JMP108 The Glue That Binds: Integrating IBM Lotus Notes & Domino with Microsoft Office and other Applications John Head – PSC Group, LLC enTouch Framework Offerings and Development Manager
    • Before we begin …
      • Please turn off/set to vibrate/mute all
        • Cell Phones
        • Pagers
        • Computers
      • Please remember to fill out your evaluations
        • Hand in at end of session
        • Fill out via Lotusphere Online
    • Who is John Head?
      • Offering and Development Manager for our enTouch frameworks
        • Technical and Sales role
      • Involved in Lotus technology since 1993
      • Speaker for over 15 sessions at Lotusphere since 1996
      • IBM Lotus Notes/Domino Certified
      • Author for Advisor Magazine and Group Computing on Office and SmartSuite integration with Notes
      • PSC Group, LLC (www.psclistens.com)
        • Midwest Mid-Market Professional Services Firm
        • Winner of 2004 Lotus Award for Best Competitive Win!
    • Purpose
      • Provide a foundation on how to begin integration projects
      • Introduce techniques for developers new to integration
      • Demonstrate some of the possibilities
      • Discuss differences in versions of Notes and Office
      • Thinking outside the box with integration on the web and other applications besides Office
      • Expect Lots of Code!
    • A little poll
      • Who is using what version of Office
        • Office 97 and earlier
        • Office 2000
        • Office XP
        • Office System 2003
        • OpenOffice / StarOffice
        • Other (SmartSuite, iWork, etc)
    • Agenda
      • Planning Ahead
      • COM and OLE demystified
      • The Big Picture
      • Integration from Notes
      • Integration from the application
      • Alternative Applications
    • Planning Ahead
      • As in any good application, the planning phase can make or break your application
        • Integration Applications exaggerate this
        • The more ‘moving parts’ the bigger the potential break
        • Integration Applications sometimes include multiple developers
    • Ask yourself “Can this be done by Notes/Domino?”
      • Do not over complicate
      • Use Notes functionality when you can
      • Rich Text will be your biggest limiting factor
      Planning Ahead
    • How does this fit into the entire N/D architecture
      • Will multiple applications require this functionality?
      • Can I build functionality once that I can reuse?
        • saving time and money
        • Makes project justification simpler
      • Look at the big picture, not the specific application
      Planning Ahead
    • Target Audience Issues
      • Version of Notes
      • Version of Application
      • Version of Browser
      • Version of Operating System
      • Connection Type
      • Other pitfalls
      Planning Ahead
    • It is time to Integrate!
      • Once you have determined that integration is your best option
      • Always use the best tool for the job
        • Do not use a shoe as a hammer …
      • Notes is not …
        • A word processor with Table of Contents, Page Layout, etc
        • A spreadsheet with charting, Pivot Tables, etc
        • A presentations tool with Screen Shows, etc
      • Do not reinvent the wheel …
      • COM and OLE are the technologies we use
      COM and OLE Demystified
    • The Good News …
      • We are in the Renaissance of the Integration Era
      • In “Medieval Times” …
        • DDE with Ami Pro
        • NotesSQL was used to get even the basic data
        • OLE Embedding
        • Notes F/X
      COM and OLE Demystified
    • Integration History
      • 1994
        • DDE with Ami Pro
      • 1996
        • Notes R4
        • OLE
        • LotusScript
        • VBA
      • 1997
        • SmartSuite with LotusScript (Word Pro)
      • 1998
        • R5 COM
      • 2001
        • ND6
      • 2004
        • ND6.5 (LS2J, DXL)
      • 2005
        • ND7 (Web Services)
      COM and OLE Demystified
    • COM Explained
      • “Component Object Model”
      • Microsoft Standard
      • Defines the guidelines for objects
        • Objects must tell all other programs what is supported
          • Properties
          • Methods
      • Consistent Programmatic access to functionality
      COM and OLE Demystified
    • OLE Explained
      • “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
      • OLE/1 – Attachments
      • OLE/2 – Linking or Embedding
      COM and OLE Demystified
    • OLE/1 – File Attachments
      • Advantages
        • Functionality clearly divided between applications
        • No memory issues
        • Much smaller size footprint
        • Enables Template usage
      • Disadvantages
        • Requires more planning
        • More effort for basic functionality
        • Attachment does not know about the Notes object, must manually connect and update
      • Notes 6 added
        • User can round trip edit attachments
      COM and OLE Demystified
    • OLE/2 – Linking and Embedding
      • Advantages
        • “ Integrated”, single interface when using embedded object (if used in-line)
        • Document containing embedded object is “aware” of the embedded object
        • Less work to get object open for end user
      • Disadvantages
        • OLE embedded objects are much bigger … 10 to 50 times
        • OLE embedding is not reliable (Office XP with Windows XP fixed most of this)
        • OLE embedded objects are difficult for users when they are more than one page
        • Application functionality is
      • Biggest issue … no clean way to export data from embedded objects
        • “ Locked” data is bad
      COM and OLE Demystified
    • Early binding VS Late binding
      • Early binding is when you declare what an object variable will be before you actually assign the object to it
        • Dim db as NotesDatabase Set db = session.CurrentDatabase
      • Late binding is when you assign an object to a variable without creating the object variable beforehand
        • Set db = New NotesDatabase(“server”, “dbname.nsf”)
      • Early binding is much more efficient than late binding
      • Only late binding available when in Notes
      COM and OLE Demystified
    • The Big Picture
      • Architectures vs. Application
      • Build reusable functionality across multiple applications
      • PSC enTouch framework was designed with this idea
      • Integration functionality written once, used in numerous applications
      • Demos developed for this session are stand-alone
      The Big Picture
    • Integration from Notes
      • From Notes, we will write application code (modified) to manipulate the application
      • In most cases, you will be converting Visual Basics for Applications (VBA) code to LotusScript
      • Our first sample
        • Create a Microsoft Word document and add content
      Integration from Notes
    • Creating a Word Document
      • Must create an instance to the application object first
      • All applications that support COM have object names
      • Find object name …
        • Application Documentation
        • Registry
      • Never use version specific application object names
        • Word.application
        • Word.application.8
      • Set hwd = CreateObject("Word.Application")
      Integration from Notes
    • Creating a Word Document
      • Must follow the applications object model
        • Word.application
          • Documents
            • Document
              • Paragraph
              • Bookmark
              • CustomDocumentProperties
        • If accessing current open document, use
          • Application.ActiveDocument
      Integration from Notes
    • Creating a Word Document
      • How did we write the data into the document?
      • Lets look at the code
      Integration from Notes
    • Speed Tip – Turn of the Display
      • By default, an object will not display when created programmatically.
      • Code executes much faster when the object is not visible
      • Prevent User issues when they can not access/see
      • Make visible at end Set hwd.visible = True
      Integration from Notes
    • How did you figure out the syntax?
      • Integration Developer’s Best friend …
        • Tools Macros Record New Macro
      • Lets try
      Integration from Notes
    • 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
        • Use the Constants Database
        • Get the database that matches your version of Office
        • Write a macro
          • Msgbox [constantname]
      Integration from Notes
    • Mail Merge
      • Mail Merge is version specific
        • One version for Word 2000 and before
        • One version for Word XP and above
          • Rumor of new format in next version
      • Sample of Office 2003 Mail Merge
      • Lets look at the code
      Integration from Notes
    • Microsoft complicates things
      • Each version of Office has Object and Syntax changes
        • Not always backwards compatible
        • Each Version has a number
          • Office 97 – 8
          • Office 2000 – 9
          • Office XP – 10
          • Office 2003 – 11
        • Need to know for reference on Microsoft Documentation
          • Otherwise forget!
      Integration from Notes
    • Mail Merge
      • Mail Merge object allows for user interaction
      • Select what pieces of the Mail Merge Wizard the user sees
      • Interaction is your choice!
      Integration from Notes
    • Building an Engine
      • Bring data and presentation together seamlessly
      • Control what data the user can include
      • Two data push methods
        • Design Time
        • Run Time
      • Demo from enTouch.crm
      • Standalone Demo
      • Lets look at the code
      Integration from Notes
    • Working with the attachment
      • Store that attachment in a rich text field
      • Programmatically detach and save the attachment
      • Let user take advantage of the ND6 in-place edit features
      Integration from Notes
    • Working with the attachment
      • Set attachmentfield = commCurrentDocument.getfirstitem(fieldname)
      • If attachmentfield.embeddedobjects(0) Is Nothing Then
      • Msgbox MSGBOX_TEXT_01, 16, MSGBOX_TITLE_01
      • Exit Function
      • End If
      • If attachmentfield.EmbeddedObjects(0).Type <> EMBED_ATTACHMENT Then
      • Msgbox MSGBOX_TEXT_02, 16, MSGBOX_TITLE_01
      • Exit Function
      • End If
      • Forall o In attachmentfield.EmbeddedObjects
      • filename = o.source
      • End Forall
      • Set Object = commCurrentDocument.GetAttachment(filename)
      • Call Object.ExtractFile (filepath + filename)
      Integration from Notes
    • Saving the attachment
      • Once the code is complete, save that attachment back to the Notes document
      • Dim newrichtextfield As notesrichtextitem
      • Dim newobject As notesembeddedobject
      • newdoc.removeitem (&quot;Attachment&quot;)
      • Set newrichtextfield = newdoc.CreateRichTextItem(&quot;Attachment&quot;)
      • Set newobject = newrichtextfield.EmbedObject(EMBED_ATTACHMENT, &quot;&quot;, filepath + filename)
      Integration from Notes
    • Lets work with Excel
      • Build an Excel spreadsheet with data from Notes
      • Generate a Chart
      • Lets see the demo
      • Lets look at the code
      Integration from Notes
    • Exporting with Excel
      • ND6 Export has lots of limitations
        • No Excel support
        • Limited to number of rows
      • Build your own Export Tool
      • Let’s see the demo
      • Let’s see the code
      Integration from Notes
    • Some other tips
      • Create objects for each object in the external application
        • Application
        • Documents
        • Document
        • Paragraph
      • Always Error Trap your code
      • AD210 Error Trapping in LotusScript
        • Speaker: Rocky Oliver
        • SW 6 - Wednesday 3:00pm - 4:00pm
      • BP104 Leveraging the LotusScript NotesLog Class to Build a Proactive Bug Tracking System
        • Speaker: Christopher Byrne
        • SW Osprey - Tuesday 8:30am - 9:30am
      Integration from Notes
    • Some other tips
      • To pass parameters, try not to use the Notes.ini
        • I prefer to use the Properties of the Document
        • Must clear the property before updating it’s value
      Integration from Notes
    • Integration from the application
      • Sometimes it makes sense to start from within the application
      • Good news
        • Easier then working from within Notes
          • If you are manipulating the Office application
        • LotusScript translates better than VBA
      Integration from the applications
    • Retrieve data from Notes
      • Sample using Microsoft PowerPoint
      • Lets look at the Code
      Integration from the applications
      • Working with the Domino Objects is almost the same as writing code in Notes!
      • Only supports back-end objects
      • COM support was added in Notes 5.0.2b
      • Updated in 6.5.1 to support 6.X
        • Objects
        • Properties
        • Methods
      • COM interface is same as LotusScript interface, with some exceptions
      Domino COM Basics Integration from the applications
    • Domino COM Basics
      • Must load the Lotus Domino Objects reference
        • In MS Office products: Tools/References
      Integration from the applications
    • Domino COM Basics
      • The COM objects must be able to find NOTES.INI
        • Looks in program directory first
        • Looks in path next
      • KeyFileName in NOTES.INI is used to determine what ID to use for authentication
      • Multiple installed versions of Notes is a problem
        • Uses the last installed version
          • HKEY_CLASSES_ROOT.nsfShellOpenCommand
          • HKEY_CLASSES_ROOT otes.exeShellOpenCommand
          • HKEY_LOCAL_MACHINESOFTWARELotusNotes
      Integration from the applications
    • Make your end users happy!
      • Prevent Password prompts by…
      • Notes Release 5.x Notes 6
      Integration from the applications
    • Domino COM Basics
      • Must use NotesSession.Initialize(“”) to establish connectivity
        • Cannot use extended syntax (I.e. “dot notation”) to reference items in a document
          • NO: NotesDocument.Form(0)
          • YES: NotesDocument.GetItemValue(“Form”)(0)
      Integration from the applications
    • Domino COM Basics
      • Can’t use “New” to create Domino objects
        • Exception is NotesSession
        • NO: Dim db as New NotesDatabase(server, dbpath)
        • YES: Dim db as NotesDatabase Set db = NotesSession.GetDatabase(server, path)
      Integration from the applications
    • Domino COM Basics
      • No such thing as a “current” environment
        • No CurrentDatabase, DocumentContext, etc.
      • If a property returns an array of objects , you must assign the property to a variable first
        • NO: Dim view as NotesView Set view = NotesDatabase.Views(0)
        • YES: Dim views as Variant, view as NotesView views = NotesDatabase.Views Set view = views(0)
      Integration from the applications
      • VB doesn’t use Forall…EndAll
        • Uses For Each…Next instead
      • VB doesn’t support Today keyword
      • VB doesn’t support using pipes ( | ) and braces ( {} ) for string delimiting
      • Refer to ND Designer Help for more info
      Domino COM Basics Integration from the applications
    • Remember the Insert Menu
      • Uses COM to read the available text values to insert into the document
      • Lets look at the code
      Integration from the applications
    • Alternative Applications
      • Microsoft Office is not the only application's) out there
      • SmartSuite still has a loyal following
      • OpenOffice (StarOffice) is gaining a foothold
      • Nice to have some options
    • SmartSuite Demo
      • Has built in connections to browse Notes databases for documents
      • Supports all of the LotusScript syntax
        • Notes 5.X syntax and below
      • Lets look at the demo
      Alternative Applications
    • OpenOffice Demo
      • Uses OLE
      • Very Different Object Model
      • Lets see the demo
      • Lets see how it works in an application
      Alternative Applications
    • Wrap-up
      • Reviewed how to architecture integration
      • Discussed the hurdles
      • Walked thru how to integrate Notes to external applications
      • Walked thru how to integration an external application with Notes
      • Looked into the future!
    • The Future
      • XML is the foundation
      • DXL provides powerful functionality
      • Web Services will remove the need for the Notes client to be installed to perform integration
      • Come see a glimpse into the future
        • BP124 Integration SuperGlue - Advanced Integration Techniques with IBM Lotus Notes and Domino and Office 2003
          • Speaker: John D Head
          • SW 1-2 - Wednesday 11:15am - 12:15pm
    • Other sessions that you should attend
      • AD211 Leveraging the Power of Object Oriented Programming in LotusScript
        • Speaker: Jens Augustiny
        • SW 10 - Monday 2:15pm - 3:15pm
      • AD204 Getting the Most From the IBM Lotus Domino Objects
        • Speaker: James Cooper
        • DL S. Hemisphere III - Monday 5:00pm - 6:00pm
      • BP107 Best Practices for Object Oriented LotusScript
        • Speaker: Bill Buchan
        • SW 10 - Thursday 8:30am - 9:30am
      • BP124 Integration SuperGlue - Advanced Integration Techniques with IBM Lotus Notes and Domino and Office 2003
        • Speaker: John D Head
        • SW 1-2 - Wednesday 11:15am - 12:15pm
    • Resources
      • LDD Discussions (www-130.ibm.com/developerworks/lotus)
      • Advisor Magazine (www.advisor.com)
        • Articles
      • MSDN (msdn.microsoft.com)
      • My blog (www.johndavidhead.com)
      • Slides and content available on PSC’s website by next Monday
        • www.psclistens.com
    • Questions & Answers Thank You! Please turn in or perform online your evaluations See the enTouch Framework at Booth #433