2017-03-08 23 views
0

我想在PowerPoint 2013中字體更改文本選擇大膽地將「Couirier新」。我試着用這個VBA腳本來改變字體:如何改變選擇的字體在PowerPoint 2013 VBA

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

但它不工作。有什麼建議麼?

+0

即時通訊不確定,但我認爲它就像selection.style.fontfamily =「Courier New」.fontstyle = Bold or font.bold = true –

回答

1

這將改變字體,使其大膽的,當你運行它

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

因爲你是從選擇運行它的文檔將應始終是積極的一個,其他明智的,你需要改變ActiveWindow

+0

很棒......謝謝 – Drago

相關問題