There is a table in the Word document with the following table
----------------
|-serial number | name |
----------------
| 1 | AA |
----------------
| 2 | bb |
------------------
I want to get the name of the value {that is AA,BB}, I use the macro to explore the ASP program, but the following ASP program reported "Set Mysel =
ListWord.Application.Selection "Missing objects?" Are the following procedures not known correctly or not?
<%
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 = "ordinal"
With Thisdocument.tables (1)
For I = 1 to. Columns.count
If InStr (1,. Cell (1, I), "serial number") > 0 Then
r = I
Exit for
End If
Next
MsgBox R
End With
Listword.quit
Set Listword = Nothing
%>
Method Two
<%
Response. Contenttype= "Application/x-msword"
Const adTypeBinary = 1
Dim strFilePath
strFilePath = "C:mainmenu.doc"
Set objstream = Server.CreateObject ("ADODB. Stream ")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
Response.BinaryWrite Objstream.read
objStream.Close
Set objstream = Nothing
%>