Skip to main content

[Migrated content. Thread originally posted on 18 August 2003]

Before I spend a bunch of time going down a dead end, would anyone know if is it possible to do something like this VB code in Acucobol:

Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.InternetExplorer

For Each IE In SWs
Set Doc = IE.document
Print Doc.url
Next

SHDocVw is a reference to the Microsoft Internet Controls (SHDOCVW.DLL).

I have generated a .DEF file for SHDOCVW.DLL.

But what I'm not clear about is:

1) How to simulate the "for each" to iterate through the SHDocVW.InternetExplorer objects

2) If I did get back an SHDocVw.InternetExplorer object, how do I access its properties (such as .document).

BTW, what this code does is gets the current URL from every instance of Internet Explorer currently open.

[Migrated content. Thread originally posted on 18 August 2003]

Before I spend a bunch of time going down a dead end, would anyone know if is it possible to do something like this VB code in Acucobol:

Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.InternetExplorer

For Each IE In SWs
Set Doc = IE.document
Print Doc.url
Next

SHDocVw is a reference to the Microsoft Internet Controls (SHDOCVW.DLL).

I have generated a .DEF file for SHDOCVW.DLL.

But what I'm not clear about is:

1) How to simulate the "for each" to iterate through the SHDocVW.InternetExplorer objects

2) If I did get back an SHDocVw.InternetExplorer object, how do I access its properties (such as .document).

BTW, what this code does is gets the current URL from every instance of Internet Explorer currently open.
You can iterate a collection by asking for the count property:

INQUIRE SW @count IN totalwin.

Then you can inquire itemwise:

PERFORM acount FROM 1 BY 1 UNTIL acount > totalwin
INQUIRE SW.Item(acount) GIVING IE
INQUIRE IE LocationURL IN myurl
DISPLAY MESSAGE BOX myurl
END-PERFORM

[Migrated content. Thread originally posted on 18 August 2003]

Before I spend a bunch of time going down a dead end, would anyone know if is it possible to do something like this VB code in Acucobol:

Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.InternetExplorer

For Each IE In SWs
Set Doc = IE.document
Print Doc.url
Next

SHDocVw is a reference to the Microsoft Internet Controls (SHDOCVW.DLL).

I have generated a .DEF file for SHDOCVW.DLL.

But what I'm not clear about is:

1) How to simulate the "for each" to iterate through the SHDocVW.InternetExplorer objects

2) If I did get back an SHDocVw.InternetExplorer object, how do I access its properties (such as .document).

BTW, what this code does is gets the current URL from every instance of Internet Explorer currently open.
You can iterate a collection by asking for the count property:

INQUIRE SW @count IN totalwin.

Then you can inquire itemwise:

PERFORM acount FROM 1 BY 1 UNTIL acount > totalwin
INQUIRE SW.Item(acount) GIVING IE
INQUIRE IE LocationURL IN myurl
DISPLAY MESSAGE BOX myurl
END-PERFORM

[Migrated content. Thread originally posted on 18 August 2003]

Before I spend a bunch of time going down a dead end, would anyone know if is it possible to do something like this VB code in Acucobol:

Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.InternetExplorer

For Each IE In SWs
Set Doc = IE.document
Print Doc.url
Next

SHDocVw is a reference to the Microsoft Internet Controls (SHDOCVW.DLL).

I have generated a .DEF file for SHDOCVW.DLL.

But what I'm not clear about is:

1) How to simulate the "for each" to iterate through the SHDocVW.InternetExplorer objects

2) If I did get back an SHDocVw.InternetExplorer object, how do I access its properties (such as .document).

BTW, what this code does is gets the current URL from every instance of Internet Explorer currently open.
Thanks - that helps and I got it to work:

01 SHELL-WINDOWS-HANDLE USAGE HANDLE OF ShellWindows.
01 IE-DOC-HANDLE USAGE HANDLE OF InternetExplorer.

....

CREATE ShellWindows OF ShDocVw
HANDLE IN SHELL-WINDOWS-HANDLE.
INQUIRE SHELL-WINDOWS-HANDLE
@Count IN NUM-BROWSERS.
PERFORM VARYING I FROM ZERO BY 1 UNTIL I = NUM-BROWSERS
MODIFY SHELL-WINDOWS-HANDLE @Item(I)
GIVING IE-DOC-HANDLE
INQUIRE IE-DOC-HANDLE
@LocationURL IN WEB-ADDR
END-PERFORM.