VBA-VB 为什么运行后,指“Content”未找到方法或数据成员,谢谢
Option Explicit
Private Sub Command1_Click()
Dim oApp As Word.Application
Dim oDoc As Word.Document
Set oApp = New Word.Application
oApp.Visible = True
Set oDoc = oApp.Documents.Add
oApp.Content.Font.Name = "宋体"
oApp.Content.Font.Size = 16
oApp.Content.Paragraphs.LineSpacing = 3
oApp.Paragraphs(oApp.Paragraphs.Count).Alignment = wdAlignParagraphCenter
oApp.Paragraphs(oApp.Paragraphs.Count).Range.Font.Bold = True
oApp.ActiveWindow.Selection.TypeText "(题目)" & vbCrLf
oApp.Content.Paragraphs.LineSpacing = 3
oApp.Paragraphs(oApp.Paragraphs.Count).Alignment = wdAlignParagraphLeft
oApp.Paragraphs(oApp.Paragraphs.Count).Range.Font.Bold = False
oApp.Paragraphs(oApp.Paragraphs.Count).Range.Font.Size = 11
oDoc.SaveAs App.Path & "\(题目).doc"
oDoc.Close
oApp.Quit
Set oDoc = Nothing
Set oApp = Nothing
End Sub