LotusScript傳值到IE

How to transfer values between Lotus Notes and Internet Explorer
出處:
SearchDomino.com
其網站列出兩種方法:
The first,
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.

The second,
'---- 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 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 ---

February 2012

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      

Archives

Powered by Movable Type 4.34-en

About this Entry

This page contains a single entry by philipz published on March 7, 2007 12:30 PM.

Inheritance and Polymorphism on LotusScript was the previous entry in this blog.

LotusScript Lists is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.