I am writing an windows application in VB.Net to automate the internet explorer using Visual Studio 2005.

There is a website with list of orders. I need to accept the orders automatically whenever they arrive.

There are 2 pages in a websiteand they will refresh at regular intervals. In the first page there is a list of elements in a grid with Accept and Decline buttons. I have to click on Accept button. Then next page loads with some text contents and a Check box and a Submit button. I need to check check box and click on the button automatically.

I am able to click the accept button on first page and the page redirects to second page. But the second page uses modal window to load the page contents with check box and submit button.

So I am not able to get the html source of that modal window. Whenever I try to get the source I am getting the source of the page in the background.

Any help in finding the source code of a modal window is much appreciable.

If it is not achievable in VB.Net, please let me know whether it is possible with any other language or tools.

Javascript code to open modal window in html page.

<script type="text/javascript">
function doopen1()
   window.showModalDialog ("win1.php",null,"dialogLeft:400,dialogTop:100px;dialogHeight:100px;dialogWidth:300px;");

My requirement is totally different. I am accessing a website which uses modal window to show page contents. I want to get the html source of that modal window using my VB.Net application.