I'm not getting anywhere with this. Perhaps I just can't see the wood for the trees.
This is the whole of the source from the webpage that I'm connecting to.
------------------------------------------------------------
<html>
<head>
<title>TIME & DATE OPTIONS</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta description= "modified 2/10/2000 JB">
<SCRIPT LANGUAGE="JavaScript" SRC="../frmpages/defines.js"></SCRIPT>
<script LANGUAGE="JavaScript">
<!--
var now_time = 1122460542;
var gps_time = 0;
var time_offset = 3600;
var locale = 'BST';
var features=112;
var TITLE = '<CENTER><BR><FONT SIZE=+2 FACE="Arial">Time & Date Options</FONT></CENTER>';
function BuildCGIURL()
{
Now=new Date()
var offset = Now.getTimezoneOffset();
var utc_offset;
var julian;
var dstr = ""
julian = Math.round(Now.getTime()/1000);
utc_offset = -(offset*60);
// build a .frm name based on the location pathname
with (location)
dstr += pathname.substring(pathname.lastIndexOf("/"),pathname.indexOf("."))+".frm";
dstr += "?";
dstr +='utc_offset=' + utc_offset + '¤t_julian=' + julian;
return dstr;
}
function SubmitTimeAndDate()
{
var CGIURL;
CGIURL = BuildCGIURL();
self.location=CGIURL;
}
function formset()
{
Now=new Date()
var offset = Now.getTimezoneOffset();
document.disform.time_val.value = Math.round(Now.getTime()/1000);
document.disform.time_offset.value = -(offset*60);
document.disform.opname$.value = ""
}
function show_time_pc(julian)
{
var time = new Date();
var offset = time.getTimezoneOffset();
var str = "";
if (julian > 0) {
time.setTime((julian * 1000) + (offset*60000));
}
str = time.toLocaleString()
return str;
}
function show_offset_pc()
{
var time = new Date();
var offset = time.getTimezoneOffset();
var str = "";
str = -(offset)
return str;
}
function show_time_target(julian)
{
var time = new Date();
var offset = time.getTimezoneOffset();
var str = "";
if (julian > 0) {
time.setTime((julian * 1000) + (time_offset*1000) + (offset*60000));
}
str = time.toLocaleString()
return str;
}
function show_time_gps(julian)
{
var time = new Date();
var offset = time.getTimezoneOffset();
var str = "";
if (julian > 0) {
time.setTime((julian * 1000) + (offset*60000));
}
str = time.toLocaleString()
return str;
}
function show_offset_target()
{
var time = new Date();
var str = "";
str = time_offset/60
return str;
}
function show_help()
{
HELP=window.open('help_timedate.html','HELP', 'resizable=yes,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,screenX=332,screenY=0');
}
//-->
</script>
</head>
<body bgcolor="#FFFFF0" background="/webpages/images/back.jpg">
<script>
<!--
var dstr=""
dstr += '<p> </p>\n';
dstr += '<FORM NAME="DateTimeOptions" ACTION="' + location.protocol + '//' + location.host + '/timedate.frm" METHOD="GET">\n';
dstr += '<CENTER>';
dstr += '<p> </p>\n';
dstr += '<p>Current System time : ' + show_time_target(now_time) + '</p>\n';
dstr += '<p>System GMT offset in mins : ' + show_offset_target() + '</p>\n';
if (locale)
dstr += '<p>Current timezone : ' + locale + '</p>\n';
dstr += '<p> </p>\n';
if (features & SYSTEM_GPS)
{
dstr += '<p>Current GPS time : ' + show_time_gps(gps_time) + '</p>\n';
dstr += '<p> </p>\n';
}
dstr += '<p>Current PC time : ' + show_time_pc(0) + '</p>\n';
dstr += '<p>PC GMT offset in mins : ' + show_offset_pc() + '</p>\n';
dstr += '<p><input TYPE="button" VALUE="Sync system time to PC" onClick="SubmitTimeAndDate()"></p>\n';
dstr += '</CENTER>';
dstr += '<p><div align=right><input TYPE="button" VALUE="Help" onClick="show_help()"></div></p>\n';
dstr += '</FORM>\n';
document.write(TITLE);
document.write( dstr );
//-->
</script>
<body bgcolor="#FFFFF0" background="/webpages/images/back.jpg"></body>
</html>
------------------------------------------------------------
I just need to click the submit button programatically so that the time and date on the remote server is synchronised to my local PC.
"WebBrowser1.Document.All("Submit").Click" gives the error "Object variable or With block variable not set."
Can anybody help, please please please.
Alan
[gray]Experience is something you don't get until just after you need it.[/gray]