Sub ToWord()
Dim wordApp As Object
Dim WordD As Word.Document
Dim Modelpath As String
Dim ThisWorkbookPath As String
Dim SaveFilePath As String
Dim SaveFileName As String
SaveFilePath = ThisWorkbook.Path & "\输出文件夹\ "
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FolderExists(SaveFilePath) = False Then
MkDir SaveFilePath '//创建文件夹
End If
Set wordApp = CreateObject("Word.Application")
wordApp.Visible = False
For r = 2 To Worksheets(1).UsedRange.Rows.Count
Set WordD = wordApp.Documents.Add
Dim str As String
str = Worksheets(1).Cells(r, 1).Value
Dim str_in As String
Dim str_out As String
str_in = Worksheets(1).Cells(r, 3).Value
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载