이모저모
여러 개의 PPT 파일 하나로 합치기
HappyWeasel
2019. 6. 11. 08:43
1. 합쳐야 할 PPT 파일을 하나의 폴더 속에 넣어줍니다.
2. 메인이 될 PPT을 열어줍니다.
3. [매크로] - [Visual Basic]을 열어줍니다.
4. [해당 Project] - 오른쪽 마우스 - [삽입] - [모듈]
5. 아래의 링크의 Solution2의 내용을 복사하여 붙여 넣은 후 종료.
Sub InsertAllSlides()
' Insert all slides from all presentations in the same folder as this one
' INTO this one; do not attempt to insert THIS file into itself, though.
Dim vArray() As String
Dim x As Long
' Change "*.PPT" to "*.PPTX" or whatever if necessary:
EnumerateFiles ActivePresentation.Path & "\", "*.PPT", vArray
With ActivePresentation
For x = 1 To UBound(vArray)
If Len(vArray(x)) > 0 Then
.Slides.InsertFromFile vArray(x), .Slides.Count
End If
Next
End With
End Sub
Sub EnumerateFiles(ByVal sDirectory As String, _
ByVal sFileSpec As String, _
ByRef vArray As Variant)
' collect all files matching the file spec into vArray, an array of strings
Dim sTemp As String
ReDim vArray(1 To 1)
sTemp = Dir$(sDirectory & sFileSpec)
Do While Len(sTemp) > 0
' NOT the "mother ship" ... current presentation
If sTemp <> ActivePresentation.Name Then
ReDim Preserve vArray(1 To UBound(vArray) + 1)
vArray(UBound(vArray)) = sDirectory & sTemp
End If
sTemp = Dir$
Loop
End Sub
6. [매크로] - [매크로 보기]
매크로 선택 후 실행