Visual Basic scripts for Internet Explorer - Manage Documents - Foundation 24.1 - Foundation 24.1 - Ready - Perceptive Content - external

Manage Documents

Platform
Perceptive Content
Product
Manage Documents
Release
Foundation 24.1
License

You can use the functions described in this section in any script in application plan types. These functions are only effective in capturing values from Microsoft Internet Explorer pages. They are useful with the Internet Explorer LearnMode type.

IECapture

This function captures the data from Internet Explorer in the form of name/value pairs and stores them for subsequent searches. It returns the number of pairs found.

Syntax
IECapture (bool useTDtags, HWND hwndSelectedWind)
Arguments
useTDTags: use this boolean if LTD tags need to be captured.
hwndSelectedWind: specifies the handle for the window to capture the data from, 0 to use the top-most Internet Explorer window.
Example
size = IECapture(false, 0)
Results
0: <PEB#1>,"Student Name:"
1: <PEB#2>,"Smith, James"
2: <PEB#3>, "Student ID:",
3: <PEB#4>,"1234567"
4: <PEB#5>,"Date of Birth:"
5: <PEB#6>, "6/14/1987"
size = 6
Example
size = IECapture(true, 0)
Results
0: <LTD#1>, “Student Name:”
1: <LTD#2>, “Smith, James”
2: <LTD#3>, “Student ID:”
3: <LTD#4>, “1234567”
4: <LTD#5>, “Date Of Birth:”
5: <LTD#6>, “”6/14/1987”
6: <LTD#7>, “First Term:”
7: <LTD#8>, “Fall 2008”
8: <PEB#1>, “Student Name:”
9: <PEB#2>, “Smith, James”
10: <PEB#3>, “Student ID:”
11: <PEB#4>, “1234567”
12: <PEB#5>, “Date of Birth:”
13: <PEB#6>, “6/14/1987”
size = 14
Note: You must use the IECapture or the IECaptureEx function first to store data for subsequent searches. All the following function examples use IECapture(true, 0) or IECaptureEx(true, 0, myArray).

IECaptureEx

This function captures a specified set of named fields from Internet Explorer and stores them for subsequent searches.

Syntax
IECaptureEx (bool useTDtags, HWND hwndSelectedWind, VARIANT* pVarIDs)
Arguments
useTDTags: use this boolean if LTD tags need to be captured.
hwndSelectedWind: specifies the handle for the window to capture the data from, 0 to use the top-most Internet Explorer window.
pVarIDs: a list of IDs to capture from Internet Explorer.
Example
myArray = Array(“CSID”, “CSID2”
size = IECaptureEx(false, 0, myArray)
Results
0: CSID, “12n53n43”
1: CSID2, “25n232”
2: <PEB#1>, “Student Name:’
3: <PEB#2>, “Smith, James”
4: <PEB#3>, “Student ID:”
5: < PEB#4>, “1234567”
6: <PEB#5>, “Date of Birth:”
7: <PEB#6>, “6/14/1987”
size = 8
Example
myArray = Array(“”)
size = IECaptureEx(true, 0, myArray)
Results
0: <LTD#1>, “Student Name:”
1: <LTD#2>, “Smith, James”
2: <LTD#3>, “Student ID:”
3: <LTD#4>, “1234567”
4: <LTD#5>, “Date of Birth”
5: <LTD#6>, “6/14/1987”
6: <LTD#7>, “First Term:”
7: <LTD#8>, “Fall 2008”
8: <PEB#1>, “Student Name:”
9: <PEB#2>, “Smith, James”
10: <PEB#3>, “Student ID:”
11: <PEB#4>, “1234567”
12: < PEB#5>, “Date of Birth”
13: <PEB#6>, “6/14/1987”
size = 14

IEGetNameByIndex

This function returns the name at the specified index.

Syntax
IEGetNameByIndex (int nIndex)
Arguments
nIndex: specifies the location of the tag. Zero returns the first tag.
Example
name = IEGetNameByIndex(1)
Results
name = “<LTD#2>”
Note: You must use the IECapture function first to store data for subsequent searches. This example uses IECapture(true, 0).

IEGetValueByIndex

This function returns the value at the specified index.

Syntax
IEGetValueByIndex (int nIndex)
Arguments
nIndex: specifies the location of the value. Zero returns the first value.
Example
value = IEGetValueByIndex(1)
Results
value = “Smith, James”
Note: You must use the IECapture function first to store data for subsequent searches. This example uses IECapture(true,0).

IEFindName

This function allows you to search for a name and it returns the location where it was found. It returns -1 if not found.

Syntax
IEFindName (LPCTSTR name, int nStart, bool bCaseSensitive)
Arguments
Name: specifies the name to search for.
nStart: specifies the location to start at. Use 0 to start the search from the beginning
bCaseSensitive: use this boolean if the search is case sensitive.
Example
nameLocation = IEFindName (“<PEB#1>”, 0, false)
Results
nameLocation = 8
Note: This function supports wild card characters such as * and ?. You must use the IECapture function first to store data for subsequent searches. This example uses IECapture(true,0).

IEFindNameReverse

This function allows you to search for a name in reverse and it returns the location where it was found. It returns -1 if not found.

Syntax
IEFindNameReverse (LPCTSTR name, int nStart, bool bCaseSensitive)
Arguments
Name: specifies the name to search for.
nStart: specifies the location to start at. Use -1 to start at the end.
bCaseSensitive: use this boolean if the search is case sensitive.
Example
nameLocation = IEFindNameReverse (“<PEB#1>”, 6, true)
Results
nameLocation = -1
Note: This function supports wild card characters such as * and ?. You must use the IECapture function first to store data for subsequent searches. This examples uses IECapture(true,0).

IEFindValue

This function allows you to search for a value and it returns the location where it was found. It returns -1 if not found.

Syntax
IEFindValue (LPCTSTR value, int nStart, bool bCaseSensitive)
Arguments
Value: specifies the value to search for.
nStart: specifies the location to start at. Use 0 to search from the beginning.
bCaseSensitive: use this boolean if the search is case sensitive.
Example
valuelocation = IEFindValue(“Student Name:”, 0, true)
Results
valueLocation = 0
Note: This function supports wild card characters such as * and ?. You must use the IECapture function first to store data for subsequent searches. This example uses IECapture(true,0).

IEFindValueReverse

This function allows you to search for a value in reverse and it returns the location where it was found. It returns -1 if not found.

Syntax
IEFindValueReverse (LPCTSTR value, int nStart, bool bCaseSensitive)
Arguments
Name: specifies the value to search for.
nStart: specifies the location to start at. Use -1 to start at the end.
bCaseSensitive: use this boolean if the search is case sensitive.
Example
valueLocation = IEFindValueReverse(“Student Name:”, -1, true)
Results
valueLocation = 8
Note: This function supports wild card characters such as * and ?. You must use the IECapture function first to store data for subsequent searches. This example uses IECapture(true,0).

IEGetValue

This function returns the value when passed the name of the name/value pair.

Syntax
IEGetValue (LPCTSTR value, bool bCaseSensitive)
Arguments
Name: specifies the name to search for.
bCaseSensitive: use this boolean if the search is case sensitive.
Example
WorkingValue = IEGetValue (“<LTD#12>”)
Results
The value, which corresponds to the name <LTD#12>, is placed into folder.
Note: This function supports wild card characters such as * and ?. You can use the IEGetValue function as a shortcut to calling IECapture and then IEGetValueByName. However, a single IECapture and multiple IEGetValueByName calls is a faster option if you need multiple values.

IEGetValueByName

This function allows you to search for a name and it returns the corresponding value. It returns an empty string if not found.

Syntax
IEGetValueByName (LPCTSTR name, bool bCaseSensitive)
Arguments
Name: specifies the name to search for.
bCaseSensitive: use this boolean if the search is case sensitive.
Example
value = IEGetValueByName(“<PEB#1>”, false)
Results
value = “Student Name:”
Note: This function supports wild card characters such as * and ?. You must use the IECapture function first to store data for subsequent searches. This example uses IECapture(true,0).

The Test button in the script editor does not always return valid results when you use these functions. To test your code, save the template, close the application plan, and then click the icon in the Perceptive Content toolbar to view the results.