home *** CD-ROM | disk | FTP | other *** search
- 'Note: EXTRACT requires Internet Explorer 6.0 or better to be installed
-
- Msgbox ("This example shows how to use a data EXTRACTION and then fill the extracted data into a new form. It uses two macros for this purpose.")
-
- dim ExchangeRate
-
- set iim1= CreateObject ("iimwsh.iim")
-
- iret = iim1.iimInit ()
- iret = iim1.iimDisplay("Extract Data")
- iplay = iim1.iimPlay("wsh-extract")
- data = iim1.iimGetLastMessage()
-
- 'Check for errors:
- If iplay = 1 Then
- MsgBox "Done, but no data extracted. This case should not happen unless there is no EXTRACT command in the macro."
- WScript.Quit(0)
- End If
-
- If iplay < 0 Then
- s = "The following error occurred: " + vbCrLf + vbCrLf + data
- MsgBox s
- WScript.Quit(0)
- End If
-
- 'Now prepare the extracted data for submission
- 'One could also add IF/THEN statements here to make descision based
- 'on extracted values.
-
- ExchangeRate= Split(data, "[EXTRACT]")
- s = "Hello Jim," +vbCrLf + vbCrLf
- s = s + "Did you know? One US$ costs " + ExchangeRate(0) + " EURO or " + ExchangeRate(1) + " British Pounds (GBP)."
-
- iret = iim1.iimDisplay("Submit extracted data")
- iret = iim1.iimSet ("-var_currency", s)
- iplay = iim1.iimPlay("wsh-extract-and-fill-part2")
-
- If iplay < 0 Then
- s = "The following error occurred: " + vbCrLf + vbCrLf + iim1.iimGetLastMessage()
- MsgBox s
- End If
-
- iret = iim1.iimExit
-
- WScript.Quit(0)
-