Robert B
Robert B

Reputation: 67

How to autofill a form in internet explorer without typing?

Tough situation here, at least this is how it seems for me. I have to complete a form, on a website, in internet explorer,at work, for 140 times and most of the data is the same, just a few fields are different from a form to another. Is there any way to make internet explorer to autofill the fields that will have the same data ? Without me typing anything ? A script or something ? I need to mention that I cannot connect to internet from this computer, due to security reasons, so if I have to code a script I would have to do it in notepad or something like this.

Upvotes: 2

Views: 623

Answers (1)

Deepak-MSFT
Deepak-MSFT

Reputation: 11365

It looks like at your workplace, you need to perform this same task again and again and for that, you are looking for some kind of automation to perform this repetitive task.

You can automate the IE browser in many ways like by using VBA IE Automation, Automate IE using PowerShell, Automate IE using Selenium Web driver, etc.

If you are available with the MS Office application on your machine then you can try to automate the IE using the Excel application. You can also use the data from Excel and fill it in the IE form.

Here is a simple example:

Sub demo()
    Dim ie
    Set ie = CreateObject("InternetExplorer.Application")
    ie.Visible = True
    ie.navigate "https://Your_site_address_here..."

    Do While ie.Busy
        Application.Wait DateAdd("s", 1, Now)
    Loop

    ie.document.getElementById("fname").Value = "ABC"
    ie.document.getElementById("lname").Value = "XYZ"
    ie.document.getElementById("submit").Click
    
    'ie.Quit
End Sub

Output:

enter image description here

If you search VBA IE Automation using the desired search engine then you can find many blogs, tutorials, and code examples.

Based on those examples, you can try to develop your own VBA automation code to fulfill your requirements.

If you cannot use Excel then you can refer to the example below. You can write PowerShell scripts by just using Notepad.

Here is the example using PowerShell:

$ie = new-object -com internetexplorer.application
$ie.visible=$true
$ie.navigate("https://Your_site_address_here...")
while($ie.busy) {sleep 1}
$ie.Document.getElementsById('fname').value = "ABC";
$ie.Document.getElementsById('lname').value = "xyz";
$ie.Document.getElementsById('submit').Click()

Further, you can decide which approach is most suitable for your requirement and then try to develop and test the solution.

Let us know if you have further questions.

Upvotes: 2

Related Questions