不需要前期引用word类型库的方法 Dim wd As Object Dim doc As Object Dim rng As Object Set wd = CreateObject("word.Application")
'Set wd = New word.application Set doc = wd.Documents.Add Set rng = doc.Content 'Clipboard.SetText Text1.Text ' 'rng.Paste doc.range.Insertafter "小把戏" & Chr(13)
doc.range.Insertafter "nknklklmlkm小人物" & Chr(13) doc.SaveAs App.Path & "\aaa.doc"
doc.Close Set wd = Nothing Set doc = Nothing End Sub |