Dim wordApp As New Word.Application Dim Doc As Word.Document Dim Para As Word.Paragraph
wordApp.Visible = True
Set Doc = wordApp.Documents.Add Set Para = wordApp.ActiveDocument.Paragraphs.Add With Para .Range.InsertBefore "这是一个标题" .Format.Alignment = wdAlignParagraphCenter .Range.Font.Color = wdColorBlue .Range.Font.Size = 20 .Range.Font.Name = "隶书" .Range.Font.Italic = True .Range.Font.Bold = True .Range.Font.Underline = wdUnderlineSingle End With
Dim Doc As Word.Document
Dim Para As Word.Paragraph
wordApp.Visible = True
Set Doc = wordApp.Documents.Add
Set Para = wordApp.ActiveDocument.Paragraphs.Add
With Para
.Range.InsertBefore "这是一个标题"
.Format.Alignment = wdAlignParagraphCenter
.Range.Font.Color = wdColorBlue
.Range.Font.Size = 20
.Range.Font.Name = "隶书"
.Range.Font.Italic = True
.Range.Font.Bold = True
.Range.Font.Underline = wdUnderlineSingle
End With
set wordApp = CreateObject("Word.Application")
wordApp.Selection.InsertFile "D:\111.txt"