How to find the input field ID (Text and Listbox)?

Asked

Viewed 57 times

1

I ran the code below and was able to identify the field ("body_x_tabc_x_identity_x_prxidentity_x_selBscenCode_x_txtselBscenCode_x_x") through the line of the Set objInputs. But I cannot identify the other fields. Among them there are also listboxes. Detail: The "display source code" function is disabled. How can I identify the fields to enter the information from the VBA? Thank you!

Declare Function apiShowWindow Lib "user32" Alias "ShowWindow" _
        (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Global Const SW_MAXIMIZE = 3
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2


Sub Botão1_Clique()
'
' Botão1_Clique Macro
'
' Cria um novo objecto do IE
Set IE = CreateObject("InternetExplorer.Application")

' Indica ao IE que deve navegar para a página
IE.Navigate "https://minhapagina.com"
IE.Visible = True
apiShowWindow IE.hwnd, SW_MAXIMIZE

' Loop de espera até o IE carregar a página
Do
DoEvents
Loop Until IE.ReadyState = 4

Set objInputs = IE.Document.getElementsByTagName("input")

' Preenche os campos necessários

IE.Document.getElementByID ("body_x_tabc_x_identity_x_prxidentity_x_selBscenCode_x_txtselBscenCode_x_x").Value = "YF - Indirect Material – Goods and services (free text)"

Set IE = Nothing

End Sub
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.