는 여기에 VBA 매크로로 파워 포인트에 삽입하는 버전입니다. PowerPoint 2010에서 만들었습니다.
이 디렉터리에는 하드 코드가 있으므로 읽을 때 디렉터리 이름을 묻는 메시지가 표시됩니다.
Sub CreatePictureSlideshow()
Dim presentation
Dim layout
Dim slide
Dim FSO
Dim folder
Dim file
Dim folderName
' Set this to point at the folder you wish to import JPGs from
' Note: make sure this ends with a backslash \
folderName = "c:\somedirectory\"
' Delete all slides and setup variables
Set presentation = Application.ActivePresentation
If presentation.Slides.count > 0 Then
presentation.Slides.Range.Delete
End If
Set layout = Application.ActivePresentation.SlideMaster.CustomLayouts(1)
Set FSO = CreateObject("Scripting.FileSystemObject")
' Retrieve the folder's file listing and process each file
Set folder = FSO.GetFolder(folderName)
For Each file In folder.Files
' Filter to only process JPG images
If LCase(Mid(file.Name, Len(file.Name) - 3, 4)) = ".jpg" Then
' Create the new slide and delete any pre-existing contents
Set slide = presentation.Slides.AddSlide(presentation.Slides.count + 1, layout)
While slide.Shapes.count > 0
slide.Shapes(1).Delete
Wend
' Add the picture
slide.Shapes.AddPicture folderName + file.Name, False, True, 10, 10
' Optional: create a textbox with the filename on the slide for reference
' Dim textBox
' Set textBox = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 10, 200, 200)
' textBox.TextFrame.TextRange.Text = file.Name
End If
Next
End Sub
"프레임"이란 무엇입니까? 그것은 그림에 윤곽 효과를 의미합니까? 사진 당 슬라이드 하나? 하나의 슬라이드에 모든 사진이 있습니까? 또한 파워 포인트에서 폴더의 사진을 검색하여 삽입하거나 ... –
예, 오타쿠, 가난한 표현으로 인해 유감입니다. 예, "프레임"에 의한 "슬라이드"를 의미합니다. 예, PowerPoint에서 슬라이드를 만들고 (원하는 그림만큼만) 슬라이드를 만든 다음 폴더에서 그림을 가져 와서 각 그림을 각 슬라이드에 삽입합니다. 하나의 슬라이드 - 하나의 그림 – brilliant
아래의 Alivo의 대답은 프로그래밍 방식의 솔루션을위한 올바른 방향입니다. PowerPoint에서 VBScript 대신 VBA를 사용하고 .NET/VSTO에서는 C# 또는 VB.NET을 사용할 수 있습니다. 그러나 이것은 프로그래밍 없이도 가능합니다. "사진 앨범"기능을 사용하여 폴더/사진을 선택하고 확인을 누릅니다. 각 그림에 대해 하나의 슬라이드가 생성됩니다. PowerPoint 2007/2010에서는 리본의 삽입 탭에서 사용할 수 있습니다. –