LoginSignup
0
1

More than 5 years have passed since last update.

VBAでサイトの特定箇所に文字を入力する 挑戦中

Posted at

VBAでサイトの特定の場所へ文字入力を行なう為のフォームテキストを記しておく。

Set objInpTxt = objIE.document.getElementsByName("構成Name=~")(0)
objTxt.value = "入力したい文字"
objIE.Document.Forms(0).Item(1).value = "入力したい文字"
Set objAll = ie.document.getElementsByTagName("input")
For Each obj In objAll
    If InStr(obj.placeholder, "●●●") > 0 Then
        obj.Focus
        obj.Value = d.name
        sendKeysWait " ", 300
        sendKeysWait "{BACKSPACE}", 200
        Exit For
    End If

[オブジェクトがない]とエラーになった場合、フォーカスする場所が違う可能性がある。

===課題===
フォーカスする場所を間違えずに特定する方法はないか。方法を探す。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1