...alternativ-Text zu einem Webbrowser Bild hinzufügen?
Autor: Horst M.Fußhöller
{ Alternative Text for a image of a TWebBrowser }
{ Alternativ - Text für ein Bild im TWebBrowser }
procedure TForm1.Button1Click(Sender: TObject);
var
HTMLDocument2Ifc: IHTMLDocument2;
HTMLSelectionObjectIfc: IHTMLSelectionObject;
HTMLTxtRangeIfc: IHTMLTxtRange;
begin
HTMLDocument2Ifc := WebBrowser1.Document as IHTMLDocument2;
HTMLDocument2Ifc.execCommand('InsertImage', False, '');
HTMLSelectionObjectIfc := HTMLDocument2Ifc.selection;
if HTMLSelectionObjectIfc.type_ = 'Control' then HTMLSelectionObjectIfc.Clear;
HTMLTxtRangeIfc := HTMLSelectionObjectIfc.createRange as IHTMLTxtRange;
HTMLTxtRangeIfc.pasteHTML('<image alt="Hello" src="c:\test.gif"> ');
end;
printed from
www.swissdelphicenter.ch
developers knowledge base