InternetExplorer.Application question 
Author Message
 InternetExplorer.Application question

If created this script:

Dim FSO, IEX
Dim strPath

strPath = "\\Server\Folder\"

Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")
Set oIE = Wscript.CreateObject("InternetExplorer.Application")

oIE.Visible = True
oIE.Navigate "about:blank"
oIE.document.Open
oIE.document.writeln "<html><title>KillerBee</title><body>"

Call Info(strPath)

function Info(Folder)

Teller = 0

Set MainFolder = FSO.GetFolder(Folder)
Set SubFolder = MainFolder.SubFolders

For Each Mapn in SubFolder
 oIE.Document.Writeln Mapn &"<br>"
Next

oIE.document.writeln "</body></html>"

End Function

Is it possible to replace the line
 oIE.Document.Writeln Mapn &"<br>"
With
 oIE.Document.Writeln <a href=" & Mapn &"</a><br>"
and call the function Info again but then the Folder must be the " href  "

Like SO:

\\ServerName\Folder1\
\\ServerName\Folder2\
\\ServerName\Folder3\
\\ServerName\Folder4\
\\ServerName\Folder5\

Then I click on \\ServerName\Folder2\

Then the page must show

\\ServerName\Folder2\Folder1
\\ServerName\Folder2\Folder2
\\ServerName\Folder2\Folder3
\\ServerName\Folder2\Folder4

and so on.

Thank for a reply.

Greetz Teun



Mon, 26 Apr 2004 00:13:18 GMT  
 InternetExplorer.Application question
This isn't an IE question.  What you're asking is how to call a sub/function recursively...

Dim FSO, IEX
Dim strPath

strPath = "\\mikhar\scripts\"

Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")
Set oIE = Wscript.CreateObject("InternetExplorer.Application")

oIE.Navigate "about:blank"
oIE.document.Open
oIE.document.writeln "<html><title>KillerBee</title><body>"

Call Info(strPath)

oIE.document.Close
oIE.document.body.style.font = "8pt verdana"

with oIE.document.parentWindow
  .moveTo 0,0
  .resizeTo .screen.availWidth/2, .screen.availHeight/2
end with

oIE.visible = true

function Info(Folder)

Teller = 0

Set MainFolder = FSO.GetFolder(Folder)
Set SubFolder = MainFolder.SubFolders

For Each Mapn in SubFolder
 oIE.Document.Writeln _
  "<a target=myFolderWindow href=" & Mapn & ">" _
  & Mapn.Path & "</a><br>"
 Info Mapn.Path '<============ call Info recursively...
Next

oIE.document.writeln "</body></html>"

End Function

--
Michael Harris
Microsoft.MVP.Scripting
--


Quote:
> If created this script:

> Dim FSO, IEX
> Dim strPath

> strPath = "\\Server\Folder\"

> Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")
> Set oIE = Wscript.CreateObject("InternetExplorer.Application")

> oIE.Visible = True
> oIE.Navigate "about:blank"
> oIE.document.Open
> oIE.document.writeln "<html><title>KillerBee</title><body>"

> Call Info(strPath)

> function Info(Folder)

> Teller = 0

> Set MainFolder = FSO.GetFolder(Folder)
> Set SubFolder = MainFolder.SubFolders

> For Each Mapn in SubFolder
>  oIE.Document.Writeln Mapn &"<br>"
> Next

> oIE.document.writeln "</body></html>"

> End Function

> Is it possible to replace the line
>  oIE.Document.Writeln Mapn &"<br>"
> With
>  oIE.Document.Writeln <a href=" & Mapn &"</a><br>"
> and call the function Info again but then the Folder must be the " href  "

> Like SO:

> \\ServerName\Folder1\
> \\ServerName\Folder2\
> \\ServerName\Folder3\
> \\ServerName\Folder4\
> \\ServerName\Folder5\

> Then I click on \\ServerName\Folder2\

> Then the page must show

> \\ServerName\Folder2\Folder1
> \\ServerName\Folder2\Folder2
> \\ServerName\Folder2\Folder3
> \\ServerName\Folder2\Folder4

> and so on.

> Thank for a reply.

> Greetz Teun



Mon, 26 Apr 2004 03:23:31 GMT  
 InternetExplorer.Application question
As I understand, you should better create an hta application. In that way
you could write to your page and reuse the function from the document
itself.
JL



Quote:
> If created this script:

> Dim FSO, IEX
> Dim strPath

> strPath = "\\Server\Folder\"

> Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")
> Set oIE = Wscript.CreateObject("InternetExplorer.Application")

> oIE.Visible = True
> oIE.Navigate "about:blank"
> oIE.document.Open
> oIE.document.writeln "<html><title>KillerBee</title><body>"

> Call Info(strPath)

> function Info(Folder)

> Teller = 0

> Set MainFolder = FSO.GetFolder(Folder)
> Set SubFolder = MainFolder.SubFolders

> For Each Mapn in SubFolder
>  oIE.Document.Writeln Mapn &"<br>"
> Next

> oIE.document.writeln "</body></html>"

> End Function

> Is it possible to replace the line
>  oIE.Document.Writeln Mapn &"<br>"
> With
>  oIE.Document.Writeln <a href=" & Mapn &"</a><br>"
> and call the function Info again but then the Folder must be the " href  "

> Like SO:

> \\ServerName\Folder1\
> \\ServerName\Folder2\
> \\ServerName\Folder3\
> \\ServerName\Folder4\
> \\ServerName\Folder5\

> Then I click on \\ServerName\Folder2\

> Then the page must show

> \\ServerName\Folder2\Folder1
> \\ServerName\Folder2\Folder2
> \\ServerName\Folder2\Folder3
> \\ServerName\Folder2\Folder4

> and so on.

> Thank for a reply.

> Greetz Teun



Mon, 26 Apr 2004 03:28:50 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. InternetExplorer.Application question

2. InternetExplorer.Application events

3. InternetExplorer.Application

4. Accessing XML island in attached internetexplorer.application object

5. InternetExplorer.Application and HTA

6. InternetExplorer.Application title bar properties

7. InternetExplorer.Application OnQuit

8. InternetExplorer.Application Object

9. InternetExplorer.Application

10. InternetExplorer Application Object or What?

11. Internetexplorer.Application

12. InternetExplorer.Application object

 

 
Powered by phpBB® Forum Software