1 个解决方案
#1
[仅供参考,尽管是VB6:
Private Sub Form_Load()]
Dim sentence As String
Dim words As String
Dim WordApp As Object
sentence = "请对您的言行负责,并遵守*有关法律法规,尊重网上道德。"
words = ""
Set WordApp = CreateObject("Word.Application")
WordApp.Documents.Add
WordApp.Selection.TypeText Text:=sentence
WordApp.Selection.HomeKey
Do
WordApp.Selection.MoveRight Unit:=2, Count:=1, Extend:=1
If WordApp.Selection.Text = vbCr Then Exit Do
words = words + WordApp.Selection.Text + vbCrLf
WordApp.Selection.MoveRight Unit:=1, Count:=1
Loop
WordApp.Quit SaveChanges:=0
Set WordApp = Nothing
MsgBox words
End
End Sub
#1
[仅供参考,尽管是VB6:
Private Sub Form_Load()]
Dim sentence As String
Dim words As String
Dim WordApp As Object
sentence = "请对您的言行负责,并遵守*有关法律法规,尊重网上道德。"
words = ""
Set WordApp = CreateObject("Word.Application")
WordApp.Documents.Add
WordApp.Selection.TypeText Text:=sentence
WordApp.Selection.HomeKey
Do
WordApp.Selection.MoveRight Unit:=2, Count:=1, Extend:=1
If WordApp.Selection.Text = vbCr Then Exit Do
words = words + WordApp.Selection.Text + vbCrLf
WordApp.Selection.MoveRight Unit:=1, Count:=1
Loop
WordApp.Quit SaveChanges:=0
Set WordApp = Nothing
MsgBox words
End
End Sub