Bonjour ,
J'ai un petit projet en cours pour contrôler une page IE via une macro en VBA.
Dans cette page , je peux remplir plusieurs combobox et textbox sans trop de problème.
Une partie me pose problème car il y'a du JAVA derrière.
Comme le montre le screen ce-dessus , je souhaite intervenir sur la textbox nommée 'search_1725289407' .
Dans une utilisation normale de la page , lorsque je remplis cette textbox, à chaque nouvelle lettre ajoutée , la combobox a coté nommée 'results_1725289407' , va chercher dans un annuaire LDAP si il existe une entrée correspondant à la textbox.
Je souhaite via vba intervenir sur la textbox 'search_1725289407'.
J'ai donc essayé de controler via un HTMLinpuElement :
Malheureusement Element is nothing et donc n'est pas trouvé dans la page.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 Dim IE As New InternetExplorer Dim IEDoc As HTMLDocument Dim Element As HTMLInputElement Set IEDoc = IE.document Set Element = IEDoc.all("search_1725289407")
voici le code qui se trouve dérriere la page :
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 <input title="Texte à rechercher (* pour tout)" type="text" ondblclick="this.value='*';" id="search_1725289407" name="____data_1725289407" size="4"> <script type="text/javascript"> Ext.get('search_1725289407').on( 'dblclick', function() {if ( Ext.get('search_1725289407').getValue().length >= 0 || Ext.get('search_1725289407').getValue() == '*') {Ext.get('results_1725289407').load({ url: '/glpi/ajax/dropdownUsers.php', scripts: true, params:'searchText='+Ext.get('search_1725289407').getValue()+'&value=0&myname=_users_id_requester&all=0&right=all&comment=1&rand=1725289407&on_change=submit()&entity_restrict=-1&used=W10=&update_item=eyJ2YWx1ZV9maWVsZG5hbWUiOiJ2YWx1ZSIsInRvX3VwZGF0ZSI6Im5vdGlmX3JlcXVlc3Rlcl8xNzI1Mjg5NDA3IiwidXJsIjoiXC9nbHBpXC9hamF4XC91ZW1haWxVcGRhdGUucGhwIiwibW9yZXBhcmFtcyI6eyJ2YWx1ZSI6Il9fVkFMVUVfXyIsImZpZWxkIjoiX3VzZXJzX2lkX3JlcXVlc3Rlcl9ub3RpZiIsImFsbG93X2VtYWlsIjp0cnVlLCJ1c2Vfbm90aWZpY2F0aW9uIjoxLCJhbHRlcm5hdGl2ZV9lbWFpbCI6IiJ9fQ==&update_link=1' });}}); Ext.get('search_1725289407').on( 'keyup', function() {if ( Ext.get('search_1725289407').getValue().length >= 0 || Ext.get('search_1725289407').getValue() == '*') {Ext.get('results_1725289407').load({ url: '/glpi/ajax/dropdownUsers.php', scripts: true, params:'searchText='+Ext.get('search_1725289407').getValue()+'&value=0&myname=_users_id_requester&all=0&right=all&comment=1&rand=1725289407&on_change=submit()&entity_restrict=-1&used=W10=&update_item=eyJ2YWx1ZV9maWVsZG5hbWUiOiJ2YWx1ZSIsInRvX3VwZGF0ZSI6Im5vdGlmX3JlcXVlc3Rlcl8xNzI1Mjg5NDA3IiwidXJsIjoiXC9nbHBpXC9hamF4XC91ZW1haWxVcGRhdGUucGhwIiwibW9yZXBhcmFtcyI6eyJ2YWx1ZSI6Il9fVkFMVUVfXyIsImZpZWxkIjoiX3VzZXJzX2lkX3JlcXVlc3Rlcl9ub3RpZiIsImFsbG93X2VtYWlsIjp0cnVlLCJ1c2Vfbm90aWZpY2F0aW9uIjoxLCJhbHRlcm5hdGl2ZV9lbWFpbCI6IiJ9fQ==&update_link=1' });}}); </script> <Span id="results_1725289407">....</span> <script type="text/javascript">function update_results_1725289407() {Ext.get('results_1725289407').load({ url: '/glpi/ajax/dropdownUsers.php', scripts: true, params:'searchText='+Ext.get('search_1725289407').getValue()+'&value=0&myname=_users_id_requester&all=0&right=all&comment=1&rand=1725289407&on_change=submit()&entity_restrict=-1&used=W10=&update_item=eyJ2YWx1ZV9maWVsZG5hbWUiOiJ2YWx1ZSIsInRvX3VwZGF0ZSI6Im5vdGlmX3JlcXVlc3Rlcl8xNzI1Mjg5NDA3IiwidXJsIjoiXC9nbHBpXC9hamF4XC91ZW1haWxVcGRhdGUucGhwIiwibW9yZXBhcmFtcyI6eyJ2YWx1ZSI6Il9fVkFMVUVfXyIsImZpZWxkIjoiX3VzZXJzX2lkX3JlcXVlc3Rlcl9ub3RpZiIsImFsbG93X2VtYWlsIjp0cnVlLCJ1c2Vfbm90aWZpY2F0aW9uIjoxLCJhbHRlcm5hdGl2ZV9lbWFpbCI6IiJ9fQ==&update_link=1' });}</script>
Auriez-vous une idée comment intervenir sur cet element ?
Merci pour vos réponses
Partager