1

我想将 powerpoint 2013 中的文本选择更改为粗体和“Couirier New”。我尝试使用此 VBA 脚本来更改字体:

Sub chengeFont()
    With ActiveDocument.Selection
        With .Font
            .Name = "Courier New"
        End With
    End With
End Sub

但它不工作。有什么建议么?

4

1 回答 1

2

这将在您运行时更改字体并使其变为粗体

With ActiveWindow.Selection.TextRange.Font
    .Name = "Courier New"
    .Bold = msoTrue
End With

由于您是从选择中运行它,因此文档应该始终是活动的,否则您将需要更改ActiveWindow

于 2017-03-08T12:10:03.500 回答