How to transfer values between Lotus Notes and Internet Explorer

How to transfer values between Lotus Notes and Internet Explorer

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

    Requires Free Membership to View

    Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

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 first published in February 2006

  • Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.