在VB中如何将list列表的内容导出到word里
1个回答
展开全部
'注意引用WORD 9.0
Private Sub Command2_Click()
Dim S1 As String
Dim appWord As New Word.Application
Dim wrdDoc As New Word.Document
Set appWord = New Word.Application
Set wrdDoc = appWord.Documents.Open("C:\TEMP\1.doc")
For i = 0 To List1.ListCount - 1
S1 = S1 & vbCrLf & List1.List(i)
Next
wrdDoc.Content.Text = S1
wrdDoc.Content.Select
appWord.Visible = True
End Sub
Private Sub Command2_Click()
Dim S1 As String
Dim appWord As New Word.Application
Dim wrdDoc As New Word.Document
Set appWord = New Word.Application
Set wrdDoc = appWord.Documents.Open("C:\TEMP\1.doc")
For i = 0 To List1.ListCount - 1
S1 = S1 & vbCrLf & List1.List(i)
Next
wrdDoc.Content.Text = S1
wrdDoc.Content.Select
appWord.Visible = True
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询