FillForm procedure
HejsaFandt følgende kode, men har et lille problem med det: Det søger ikke i forskellige frames i et dokument...
Kan det lade sig gøre at lave den frame kompatibel?
function FillForm(WebBrowser: TWebBrowser; Fieldname: String; Value: String): Boolean;
var
I, J : Integer;
FormItem: Variant;
begin
Result := False;
//no form on document
If WebBrowser.OleObject.Document.all.tags('FORM').length=0 then
begin
Exit;
end;
//count forms on document
for I := 0 to WebBrowser.OleObject.Document.forms.Length -1 do
begin
FormItem := WebBrowser.OleObject.Document.forms.Item(I);
For J := 0 to FormItem.Length-1 do
begin
try
//when the fieldname is found, try to fill out
if FormItem.Item(J).Name = FieldName then
begin
FormItem.Item(j).Value := Value;
Result := True;
end;
except
Exit;
end;
end;
end;
end;