Home > Domino Tips > Developer > LotusScript > How to transfer values between Lotus Notes and Internet Explorer
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

LOTUSSCRIPT

How to transfer values between Lotus Notes and Internet Explorer


Janardan Pagadala
02.28.2006
Rating: -3.26- (out of 5)


Lotus Notes and Domino tips, tutorials and how-to articles
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


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.

    Rate this Tip
    To rate tips, you must be a member of SearchDomino.com.
    Register now to start rating these tips. Log in if you are already a member.




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



    RELATED CONTENT
    LotusScript
    LotusScript finds the first occurrence of a string from the right
    Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
    Search Microsoft Active Directory with LotusScript
    Three steps to trap and handle save conflicts with LotusScript
    Troubleshoot agents by displaying LotusScript variables online
    LotusScript sorts lists alphabetically
    LotusScript code rebuilds corrupted busytime.nsf file
    Soft-code item names to facilitate LotusScript management
    LotusScript agent automates selective mail file replication
    LotusScript filters and attaches files to a Notes form

    LotusScript
    LotusScript finds the first occurrence of a string from the right
    Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
    Search Microsoft Active Directory with LotusScript
    Three steps to trap and handle save conflicts with LotusScript
    Troubleshoot agents by displaying LotusScript variables online
    LotusScript sorts lists alphabetically
    Run or restart Notes/Domino agents via text messages
    LotusScript code rebuilds corrupted busytime.nsf file
    Soft-code item names to facilitate LotusScript management
    LotusScript agent automates selective mail file replication

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    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.



  • Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
    HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts