Manage Learn to apply best practices and optimize your operations.

How to transfer values between Lotus Notes and Internet Explorer

In this tip, SearchDomino.com member Janardan Pagadala explains step-by-step how to use LotusScript to open an Internet Explorer browser as dialog box to transfer values between a Lotus Notes client and a Web-based application.

VIEW MEMBER FEEDACK TO THIS TIP

This tip explains step-by-step how to use LotusScript to open an Internet Explorer browser as dialog box to transfer values between a Lotus Notes client and a Web-based application.

  1. Create a form.

  2. Go to Form Global Declaration and declare the following:
    Dim Uidoc as NotesUidocument
    Dim IE as variant
    
  3. Create an Editable Field Name called "HTML."

  4. Create a button named "Open," and then copy the following script:
    Dim Ws as New NotesUiWorkspace Set Uidoc=
    Ws.CurrentDocument Set IE=CreateObject("InternetExplorer.Application")
    IE.Height=450
    IE.Width=550
    IE.ToolBar=False
    IE.StatusBar=False
    IE.Resizable=False
    IE.Navigate "http://notes.net/46dom.nsf"
    IE.visible=True
    
  5. Create a button and name it "Populate":
    Dim StrValue as string
    StrValue=IE.document.getElementByID("content-table").innerHTML
    IE.Quit
    call uidoc.FieldSetText("HTML",StrValue)
    
  6. Compose the form.

  7. Click on the "Open" button, and you'll find a "dialog box" opening the "notes.net" Web site.

  8. Go back to Lotus Notes, click on the "Populate" button, and you will see the HTML populated in the Lotus Notes field.


MEMBER FEEDBACK TO THIS TIP

This is a very interesting example. I've used the web retriever database to do this sort of thing in the past.

I had to play with the code and added a pause and retry loop in the "OPEN" script to perform the "POPULATE" function. (This could also be used as the code behind the POPULATE button)

'---- append to OPEN script 

'Repeat until we give up or have success .. 
Const retry_count = 20 
Const ElementID = "content-table" 
        
Dim aa%, Success% 
Dim StrValue As String 
        
aa = 0 
Success = False 
        
On Error Goto KeepTrying
GetElement: 
' This fails if the page is not loaded yet 
StrValue=IE.document.getElementByID
( ElementID ).innerHTML


' We only get here if we retrieved the element ..
Call uidoc.FieldSetText("HTML",StrValue)
Success = True
Goto TheEnd

TryAgain:
Sleep 1
aa = aa + 1
If (aa<retry_count) And (Not Success) 
Then Goto GetElement 
TheEnd: 
IE.Quit 
If Success Then 
Print "Success in " & aa & " second(s)" 
Else 
Beep 
Print |Failed: either the URL did not load in | 
& retry_count & | seconds or the element "| 
& ElementID & |" does not exist in the page.| 
End If 
Exit Sub

KeepTrying: 
Resume TryAgain
'---- end code ---

—Mark R.

Do you have comments on this tip? Let us know.


Related information from SearchDomino.com:

  • LotusScript Learning Guide
  • FAQ: LotusScript
  • More LotusScript tips and resources

    This tip was submitted to the SearchDomino.com tip library by member Janardan P. Please let others know how useful it is via the rating scale at the end of the tip. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

  • This was last published in February 2006

    Dig Deeper on LotusScript

    Start the conversation

    Send me notifications when other members comment.

    Please create a username to comment.

    -ADS BY GOOGLE

    SearchWindowsServer

    Search400

    • iSeries tutorials

      Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

    • V6R1 upgrade planning checklist

      When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

    • Connecting multiple iSeries systems through DDM

      Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

    SearchDataCenter

    SearchContentManagement

    Close