--
If Vars("nType")=0 Then \'word
str = str &".docx"
Dim app As New MSWord.Application
try
Dim dic = app.Documents.add
strLuJing="d:\\Download\\"&str
dic.SaveAs(strLuJing)
app.Visible = True
catch ex As exception
msgbox(ex.message)
app.Quit
finally
End try
ro = Tables("文档信息").AddNew
ro("名称") = str
ElseIf Vars("nType")=1 Then
str = str &".xlsx"
Dim App As New MSExcel.Application
App.Visible = True
Dim Wb As MSExcel.Workbook = App.WorkBooks.Add
Wb.WorkSheets(1).name = str
strLuJing="d:\\Download\\"&str
Wb.SaveAs(strLuJing)
Wb = App.WorkBooks.Open(strLuJing)
ro = Tables("文档信息").AddNew
ro("名称") = str