Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open attached in an iFrame?

Status
Not open for further replies.

gibbo171

Programmer
Dec 13, 2007
33
GB
Hi All

I was kindly provided the code below on this forum by Mark,

I have a webpage with an iframed named myIframe on it, my question is can i get this to open up in the iframe on my page?

thanks

Gibbo

On Error Resume Next
Dim objFSO, oFO, oFolder, oFile, picDir, IE
Set objFSO = CreateObject("Scripting.FileSystemObject")
picDir = "C:\Users\markmac\Pictures"

Set oFolder = objFSO.GetFolder(picDir)
Set IE = CreateObject("InternetExplorer.Application")
IE.toolbar = false : IE.menubar = false : IE.statusbar = false : IE.Resizable = False

For Each oFile In oFolder.Files
If Right(oFile.Name,3) = "jpg" Or Right(oFile.Name,3) = "gif" Then
IE.Navigate2 "file://" & Replace(oFile.ParentFolder,"\","/")&"/" & oFile.Name
IE.Visible = True
WScript.Sleep 1000
End If
Next

Set IE = Nothing
Set objFSO = Nothing
 
I don't do a lot of web scripting, but I would imagine all you need to do is to use your iFrame object instead of creating a new IE object.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
can anyone give an example please

thanks

gibbo
 
Well I could give you an example. I would do it by looking up the properties and methods for an iFrame and decide which iFram property/method matched each of the IE properties and methods in the code that you already had then changing the code to use the iFrame object and methods. But of course you could do that too.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top