如何在ASP里读取WORD,EXCEL,POWERPOINT等文件的内容(30分)

  • 主题发起人 主题发起人 coolcat3000
  • 开始时间 开始时间
C

coolcat3000

Unregistered / Unconfirmed
GUEST, unregistred user!
如何在ASP里读取WORD,EXCEL,POWERPOINT等文件的内容,是在网页里显示,不是做下载的
 
流的保存和读取或许可解决
 
用dsoframer.ocx控件可以显示
 
set objExcel = CreateObject("Excel.Application")
objExcel.Application.Visible=false
objExcel.WorkBooks.Open(exectfile)
set objExcelBook = objExcel.ActiveWorkBook
set objExcelSheets = objExcelBook.Worksheets
set objExcelSheet = objExcelBook.Sheets(1)
'取资产负债表内数据
for i = 1 to 29
myarray(i,1) = trim(objExcelSheet.Cells(i+4,1).value)
myarray(i,2) = trim(objExcelSheet.Cells(i+4,2).value)
myarray(i,3) = trim(objExcelSheet.Cells(i+4,5).value)
myarray(i,4) = trim(objExcelSheet.Cells(i+4,6).value)
if isNumeric(trim(objExcelSheet.Cells(i+4,7).value)) then
myarray(i,5) = FormatNumber(trim(objExcelSheet.Cells(i+4,7).value),1)
else
myarray(i,5) = trim(objExcelSheet.Cells(i+4,7).value)
end if
myarray(i+29,1) = trim(objExcelSheet.Cells(i+4,8).value)
myarray(i+29,2) = trim(objExcelSheet.Cells(i+4,9).value)
myarray(i+29,3) = trim(objExcelSheet.Cells(i+4,12).value)
myarray(i+29,4) = trim(objExcelSheet.Cells(i+4,13).value)
if isNumeric(trim(objExcelSheet.Cells(i+4,14).value)) then
myarray(i+29,5) = FormatNumber(trim(objExcelSheet.Cells(i+4,14).value),1)
else
myarray(i+29,5) = trim(objExcelSheet.Cells(i+4,14).value)
end if
next
'关闭EXCEL
objExcel.ActiveWorkBook.close
objExcel.WorkBooks.close
objExcel.DisplayAlerts=false
objExcel.Quit
set objExcelSheet = nothing
set objExcelSheet = nothing
set objExcelBook = nothing
set objExcel = Nothing
 
看一下OFFICE 操作
 
用楼上的楼上的方式,速度能快吗?????
想做搜索的话,估计比牛车还慢吧?我也需要这功能。。。
希望有人有更好的建议
 
后退
顶部