2016-07-07 5 views
0

글꼴을 변경하는 코드가 있지만 동작하지 않습니다 :(모든 프레젠테이션을 반복하고 InputBox로 글꼴 크기와 스타일을 변경하고 싶습니다. 누구나 도움이 될 수 있습니까?글꼴 크기 및 스타일 변경

Sub FormatTextBoxes() 

Dim intSlide As Integer 
Dim strNotes As String 
Dim nts As TextRange 
Dim strFont, intSize 

intSize = InputBox("Please enter font size", "fontsize", "12") 
strFont = InputBox("Please enter font", "font type", "Calibri") 

    With ActivePresentation 

     For intSlide = 1 To .Slides.Count 
     Set nts = ActivePresentation.Slides(intSlide).NotesPage. _ 
     Shapes.Placeholders(2).TextFrame.TextRange 
     With nts 
      If intSize = "" Then intSize = 12 
      .Paragraphs.Font.Size = intSize 
      .Paragraphs.Font.Name = strFont 

    End With 

     Next intSlide 
    End With 
    MsgBox ("FormatNotes uitgevoerd") 

End Sub 
+0

정확히 글꼴 크기/스타일을 변경 원하는 작업 객체이 코드는 노트 페이지의 텍스트 자리 표시자를 해결 객체 만. –

답변

1

이 모든 슬라이드에서 모든 슬라이드 개체의 글꼴 크기를 변경합니다 :

Option Explicit 

' ************************************************************* 
' Purpose : PowerPoint macro to change font size for all shapes 
'   on all slides across the active presentation 
' Author : Jamie Garroch of http://YOUpresent.co.uk/ 
' Inputs : None 
' Outputs : None 
' ************************************************************* 
Sub ChangeFontSizeForSlideShapes() 
    Dim oSld As Slide 
    Dim oShp As Shape, oGrpItem As Shape 
    For Each oSld In ActivePresentation.Slides 
    For Each oShp In oSld.Shapes 
     If oShp.Type = msoGroup Then 
     For Each oGrpItem In oShp.GroupItems 
      If oGrpItem.HasTextFrame Then 
      oGrpItem.TextFrame.TextRange.Font.Size = 12 
      End If 
     Next ' oGrpItem 
     Else 
     If oShp.HasTextFrame Then 
      oShp.TextFrame.TextRange.Font.Size = 12 
     End If 
     End If 
    Next ' oShp 
    Next ' oSld 
End Sub 
+0

대단히 감사합니다! :) – Norby