最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ASP读取WORD文档中表格数据
时间:2022-06-29 14:26:11 编辑:袖梨 来源:一聚教程网
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 = "序号"
With ThisDocument.Tables(1)
For I = 1 To .Columns.Count
If InStr(1, .Cell(1, I), "序号") > 0 Then
r = I
Exit For
End If
Next
MsgBox r
End With
ListWord.Quit
Set ListWord = Nothing
%>
方法二
<%
response.ContentType= "application/x-msword "Const adTypeBinary = 1
Dim strFilePathstrFilePath = "c:mainmenu.doc "
Set objStream = Server.CreateObject( "ADODB.Stream ")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePathResponse.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
%>
相关文章
- 《复体重剪版》游戏攻略 简述+配置+下载 05-17
- 《夜族崛起》无情铁制武器图纸获取攻略 05-17
- 《哈迪斯2》隐藏6个金色信物解锁方法 05-17
- 《夜族崛起》解锁书房科技方法 05-17
- 《鲻鱼狂杰克》成就达成条件一览 05-17
- 《庄园领主》羊购买位置 05-17