Dim wordapp As Word.Application
Dim doc As Word.Document
Dim sel As Word.Selection
Dim ff, fn As String
Set wordapp = New Word.Application
wordapp.Documents.Add
Set doc = wordapp.ActiveDocument
Set sel = wordapp.Selection
fn = InputBox("*****", "xxxxx")
ff = App.Path & "\" & fn
sel.TypeText ("dkkfkfkdkdkfkkkakk")
doc.SaveAs ff
Debug.Print ff
wordapp.Visible = True
Set wordapp = Nothing
Dim wordapp As New Word.Application
Dim worddoc As Word.Document
Dim text As Word.Selection
Set worddoc = wordapp.Documents.Add(, , , True)
Set text = wordapp.Selection
text.TypeText ("你是否会了,哈哈!")
Set line1 = worddoc.Paragraphs(1).Range
line1.ParagraphFormat.Alignment = wdAlignParagraphCenter
With line1.Font
.Bold = True
.Name = "宋体"
.Size = 20
End With
wordapp.Visible = True
Dim wordapp As New Word.Application
Dim worddoc As Word.Document
Dim text As Word.Selection
Set worddoc = wordapp.Documents.Add(, , , True)
Set text = wordapp.Selection
text.TypeText ("你是否会了,哈哈!")
Set line1 = worddoc.Paragraphs(1).Range
line1.ParagraphFormat.Alignment = wdAlignParagraphCenter
With line1.Font
.Bold = True
.Name = "宋体"
.Size = 20
End With
wordapp.Visible = True