NET 操作 WORD(VBA) VB
NET 操作 WORD 1Public Class WordOpLib 2 3 4 Private oWordApplic As Word
ApplicationClass 5 Private oDocument As Word
Document 6 Private oRange As Word
Range 7 Private oShape As Word
Shape 8 Private oSelection As Word
Selection 9 10 11 Public Sub New() 12 '激活 com word 接口 13 oWordApplic = New Word
ApplicationClass 14 oWordApplic
Visible = False 15 16 End Sub 17 '设置选定文本 18 Public Sub SetRange(ByVal para As Integer) 19 oRange = oDocument
Paragraphs(para)
Range 20 oRange
Select() 21 End Sub 22 Public Sub SetRange(ByVal para As Integer, ByVal sent As Integer) 23 oRange = oDocument
Paragraphs(para)
Sentences(sent) 24 oRange
Select() 25 End Sub 26 Public Sub SetRange(ByVal startpoint As Integer, ByVal endpoint As Integer, ByVal flag As Boolean) 27 If flag = Tru