天家word对象好了
================================================================
[email protected]
================================================================
================================================================
[email protected]
================================================================
Private Sub Command1_Click()
'需要引用microsoft word 9.0 libaray
Dim wdapp As Word.application
Set wdapp = CreateObject("Word.Application")
'wordObject.Visible = True
'wordObject.Activate
wdapp.Documents.Open FileName:="c:\abc.doc"
wdapp.selection.wholestory
wtx = wdapp.selection.Text
wdapp.Quit
Open "d:\abc.txt" For Output As #1
Do
p = InStr(wtx, Chr(13))
If p = 0 Then Exit Do
ln = Len(wtx)
px = Left(wtx, p - 1)
Print #1, px
wtx = Right(wtx, ln - p)
Loop
Print #1, wtx
Close
msgbox "ok!"
End Sub