掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
frameのあるなしにかかわらず (ID:80644)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
ありがとうございます。 >frames.lengthで有無を調べ、その中のdocumentを再帰的に処理 具体的にお聞きしてもよろしいでしょうか。 以下のコードなのですが Sub aaa() Dim ie As InternetExplorer Dim myFrames As FramesCollection, myF As Object, i Dim objINP As Object, OB As Object Set ie = New InternetExplorer ie.Visible = True ie.Navigate "あっち" Do While (ie.Busy) Loop Do While (ie.document.ReadyState <> "complete") Loop Set myFrames = ie.document.Frames If myFrames.Length <> 0 Then For Each myF In myFrames Set objINP = myF.document.getElementsByTagName("INPUT") For Each OB In objINP 'ここのFORと If OB.Type = "text" Then If OB.Name = "名前" Then OB.Value = "ほげほげ" End If If OB.Name = "ZIP" Then OB.Value = "100-0001" End If '以下まだまだIFがつづく End If Next OB Next Else Set objINP = ie.document.getElementsByTagName("INPUT") For Each OB In objINP 'ここのFORが上とまったく同じで無駄な記述になってしまう。 If OB.Type = "text" Then If OB.Name = "名前" Then OB.Value = "ほげほげ" End If If OB.Name = "ZIP" Then OB.Value = "100-0001" End If '以下まだまだIFがつづく End If Next OB End If End Sub
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.