Highlighted
Absent Member.
Absent Member.
701 views

[archive] Is it possible to do this?

[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.
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Is it possible to do this?

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
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Is it possible to do this?

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.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.