0

我想用我自己的覆盖 Word 2010 标准快速样式。但我收到如下所示的错误:

With tempDoc.Styles(wdStyleNormal) '// <-- here is the error
        .Font.Name = "Arial"
        .Font.Size = 10
        .ParagraphFormat.Alignment = wdAlignParagraphJustify
        .ParagraphFormat.LineSpacing = 12
End With

你可以在这里找到整个代码:http: //qranberry.com/stackoverflow/code.bas

4

1 回答 1

0

您需要像下面这样设置文档.. 代码在我的系统中经过测试并且工作正常

Sub test()
Dim tempDoc As Document 
Set tempDoc = ActiveDocument
With tempDoc.Styles(wdStyleNormal) ' or u can use activedocument instead of tempdoc 
        .Font.Name = "Arial"
        .Font.Size = 30
        .ParagraphFormat.Alignment = wdAlignParagraphJustify
        .ParagraphFormat.LineSpacing = 12
End With
End Sub
于 2013-10-15T07:37:30.227 回答