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 ---
Recent Comments