HotXLS-dokumentation

SaveAsHTML metod

Saves Workbook in HTML file. Returnerar 1 if it succeeds

Anmärkningar

This method is deprecated. Use IXLSWorkbook.SaveAs method
Hyperlänkar i exporterade kalkylbladsceller skrivs som HTML-ankartaggar Hyperlänkens adress genereras som href, ScreenTip text is emitted as a title attribute, and all attribute and display text is HTML-escaped
Cell comments are emitted as escaped title -attribut på de exporterade tabellcellerna, så granskningsanteckningar förblir tillgängliga som webbläsartooltips i den genererade HTML:en
To customize exporter behavior, create TXLSHTMLExport directly. Its Options property defaults to [xhHyperlinks, xhComments]; remove xhHyperlinks to write linked cells as plain escaped text, or remove xhComments to suppress comment title output Set Title to write an escaped HTML document <title> value. Set SimpleExport för att skriva en minimal tabell utan genererade CSS-klasser, hyperlänkankare eller titelattribut för kommentarer. Använd TableBorderWidth, CellPadding, and CellSpacing to control the generated table layout attributes

Syntax

function SaveAsHTML(FileName: WideString): Integer;
FileName WideString. En sträng som anger namnet på filen som ska sparas. Du kan ange en fullständig sökväg; gör du inte det sparar Workbook filen i aktuell mapp

Exempel

Exemplet skapar en ny arbetsbok med två kalkylblad och sparar sedan arbetsboken som HTML-fil

Var
  Workbook: IXLSWorkbook;
begin
  Workbook := TXLSWorkbook.Create; {create new Workbook}
  Workbook.Worksheets.Add;
  {....}
  Workbook.Worksheets.Add;
  {....}
  Workbook.SaveAsHTML('C:\book.html');
end;