Results 1 to 4 of 4
  1. #1
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409

    unable to add edge control reference

    Hi, bing made this code

    Code:
    Private Sub Form_Open(Cancel As Integer)Dim browser As Microsoft.Web.WebView2.WinForms.WebView2
    'Ottenere gli elementi HTML delle caselle di testo da riempire usando il metodo GetElementById o GetElementsByClassName del documento HTML. Per esempio:
    Dim txtNome As Object
    Dim txtCognome As Object
    
    
    Set txtNome = browser.CoreWebView2.Document.GetElementById("nome")
    Set txtCognome = browser.CoreWebView2.Document.GetElementById("cognome")
    
    
    
    
    'Assegnare all’oggetto browser il controllo edge desiderato. Per esempio:
    Set browser = Me.WebView21
    
    
    'Navigare al sito web che contiene le caselle di testo da riempire. Per esempio:
    browser.CoreWebView2.Navigate "https://www.example.com"
    
    
    'Attendere che la pagina sia completamente caricata. Per esempio:
       Do While browser.CoreWebView2.ReadyState <> CoreWebView2ReadyState.Complete
          DoEvents
       Loop
    
    
    
    
    'Assegnare i valori desiderati agli elementi HTML usando la proprietà Value. Per esempio:
       txtNome.Value = "Mario"
       txtCognome.Value = "Rossi"
    
    
    
    
    End Sub
    i use it to fill a web site with two values in two textbox, but i get the error cause i have not reference of the edge control.
    It told me that the reference is "Microsoft.Web.WebView2.WinForms.dll", but i cannot find in reference list, and if i click on browse this dll is not in the place bing told me, but it says that's ok. However, i cannot add the reference, it is impossible.

    How can i add edge control reference?


    thx

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    thanks, i've already the runtime, i can't insert the reference in vba thou

    Click image for larger version. 

Name:	Screenshot 2023-10-25 170653.png 
Views:	8 
Size:	18.4 KB 
ID:	50942

  4. #4
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    i don't need any of that, if you want to fill some textbox in a web site on an edge control just do that

    Code:
    Private Sub Comando2_Click()   Me.EdgeBrowser1.ExecuteJavascript "document.getElementById('cognome').value = 'Microsoft Access';"
    
    
    End Sub
    you have to click on ms edge on the texbox you want to fill to get the "id" of the element (mine is "cognome") and the game is done
    pretty wonderful

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Edge Browser Control - Inconsistent Behavior
    By jimmykent in forum Access
    Replies: 6
    Last Post: 10-21-2023, 11:43 AM
  2. Replies: 4
    Last Post: 04-04-2021, 09:04 AM
  3. Replies: 7
    Last Post: 03-09-2018, 11:11 PM
  4. Replies: 15
    Last Post: 05-12-2016, 02:27 PM
  5. Replies: 4
    Last Post: 07-09-2014, 10:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums