procedure TForm1.XTHtml1Click(Sender: TObject);
var
dd,aa:olevariant;
sdir:string;
begin
dd:=createoleobject('word.application');
aa:=dd.Documents.Open('C:\XXX.HTML');
sdir:=C:\XXX.DOC;
aa.saveas(sdir,8);
aa.close;
dd.quit;
end;除了8还有一些什么参数吗??都是什么意思啊?

解决方案 »

  1.   

    可惜 我的计算机没有安装OFFICE,不然我可以帮你查找一个SAVEAS这个函数的详细说明的,你只要在自己的计算机上查一下就可以了呀
      

  2.   

    Saves changes to the chart or worksheet in a different file.expression.SaveAs(FileName, FileFormat, Password, WriteResPassword, ReadOnlyRecommended, CreateBackup, AddToMru, TextCodepage, TextVisualLayout, Local)expression   Required. An expression that returns one of the above objects.Filename   Optional Variant. A string that indicates the name of the file to be saved. You can include a full path; if you don't, Microsoft Excel saves the file in the current folder.FileFormat   Optional Variant. The file format to use when you save the file. For a list of valid choices, see the FileFormat property. For an existing file, the default format is the last file format specified; for a new file, the default is the format of the version of Excel being used.Password   Optional Variant. A case-sensitive string (no more than 15 characters) that indicates the protection password to be given to the file.WriteResPassword   Optional Variant. A string that indicates the write-reservation password for this file. If a file is saved with the password and the password isn't supplied when the file is opened, the file is opened as read-only.ReadOnlyRecommended   Optional Variant. True to display a message when the file is opened, recommending that the file be opened as read-only.CreateBackup   Optional Variant. True to create a backup file.AddToMru   Optional Variant. True to add this workbook to the list of recently used files. The default value is False.TextCodePage   Optional Variant. Not used in U.S. English Microsoft Excel.TextVisualLayout   Optional Variant. Not used in U.S. English Microsoft Excel.Local  Optional Variant. True saves files against the language of Microsoft Excel (including control panel settings). False (default) saves files against the language of Visual Basic for Applications (VBA) (which is typically US English unless the VBA project where Workbooks.Open is run from is an old internationalized XL5/95 VBA project).
    XlFileFormat can be one of these XlFileFormat constants. 
    xlCSV 
    xlCSVMSDOS 
    xlCurrentPlatformText 
    xlDBF3 
    xlDIF 
    xlExcel2FarEast 
    xlExcel4 
    xlAddIn 
    xlCSVMac 
    xlCSVWindows 
    xlDBF2 
    xlDBF4 
    xlExcel2 
    xlExcel3 
    xlExcel4Workbook 
    xlExcel5 
    xlExcel7 
    xlExcel9795 
    xlHtml 
    xlIntlAddIn 
    xlIntlMacro 
    xlSYLK 
    xlTemplate 
    xlTextMac 
    xlTextMSDOS 
    xlTextPrinter 
    xlTextWindows 
    xlUnicodeText 
    xlWebArchive 
    xlWJ2WD1 
    xlWJ3 
    xlWJ3FJ3 
    xlWK1 
    xlWK1ALL 
    xlWK1FMT 
    xlWK3 
    xlWK3FM3 
    xlWK4 
    xlWKS 
    xlWorkbookNormal 
    xlWorks2FarEast 
    xlWQ1 
    xlXMLSpreadsheet expression.FileFormat
      

  3.   

    来个中文的:)SaveAs 方法
                    用一个新的文件名或格式来保存指定文档。此方法的参数与“文件”菜单的“另存为”对话框中的选项相对应。语法expression.SaveAs(FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter)expression   必需。该表达式返回一个 Document 对象。FileName   Variant 类型,可选。文件名。默认为当前文件夹和文件名。如果从未保存过此文档,则将使用默认的文件名(例如,文档 1.doc)。如果已有 FileName 指定的文档,则覆盖此文档,而且在覆盖前不提醒用户。FileFormat   Variant 类型,可选。文档保存的格式。可为以下 WdSaveFormat 常量之一:wdFormatDocument、wdFormatDOSText、wdFormatDOSTextLineBreaks、wdFormatEncodedText、wdFormatHTML、wdFormatRTF、wdFormatTemplate、wdFormatText、wdFormatTextLineBreaks 或 wdFormatUnicodeText。指定 FileConverter 对象的 SaveFormat 属性的相应值,可将文档保存为其他格式。LockComments   Variant 类型,可选。如果为 True,则此文档只允许进行批注。Password   Variant 类型,可选。打开文档时的口令。AddToRecentFiles   Variant 类型,可选。如果为 True,则将文档添至“文件”菜单中最近使用的文档列表中。WritePassword   Variant 类型,可选。保存对文档的修改所需的口令。ReadOnlyRecommended   Variant 类型,可选。如果为 True,在每次打开文档时,Word 将建议用户采用只读方式。EmbedTrueTypeFonts   Variant 类型,可选。如果为 True,则将文档与 TrueType 字体一起保存。SaveNativePictureFormat   Variant 类型,可选。如果为 True,则从其他系统平台(例如 Macintosh)导入的图形仅保存其 Windows 版本。SaveFormsData   Variant 类型,可选。如果为 True,则将窗体中用户输入的数据存为一条数据记录。 SaveAsAOCELetter   Variant 类型,可选。如果文档包含一个附加,当此属性值为 True 时,将文档存为一篇 AOCE 信笺(同时保存邮件)。