ASP读取WORD文档中表格数据
word文档中有一table,有如下表格----------------
|序号 | 名称 |
----------------
| 1 | aa |
----------------
| 2 | bb |
------------------
我要获取名称的值{也就是aa,bb},我用宏来摸索ASP程序,但以下ASP程序报“Set Mysel = ListWord.Application.Selection”缺少对象?后续程序也不知道正确与否?
<%
Set ListWord = Server.CreateObject("Word.Application")
ListWord.Documents.Add Server.MapPath("weihu/importfile")&"\wwww.doc", , , True
ListWord.Visible = True
Set Mysel = ListWord.Application.Selection
Mysel.Find.ClearFormatting
Mysel.Find.Replacement.ClearFormatting
Mysel.Find.Text = "序号"
If Mysel.Find.Execute Then
ListWord.Selection.MoveDown
ListWord.Selection.MoveRight
tempstr = ListWord.Selection '获取名称值
Response.Write tempstr
end if
ListWord.Quit
Set ListWord = Nothing
%> 这个问题测试一下就行了。
页:
[1]