파워 포인트 프로그래밍에 익숙하다. 문제가 발생했습니다. 기본적으로 매크로 이미지가있는 폴더의 경로를 가져 와서 슬라이드 당 하나의 이미지를 배치하는 매크로 스크립트가 있습니다. 이제 매크로 스크립트를 사용하여 슬라이드에 4 또는 6 또는 8 개의 이미지를 넣을 지 여부를 묻습니다. 내가 기대하고있어 출력은 다음과 같습니다 :이미지를 가져 와서 파워 포인트의 배열에 배치하기
내가이 "가 삽입 된 photoalbum"에 의해 수행하지만 문제는 슬라이드 당 네 개의 이미지 만 옵션이있다 할 수 있다는 것을 알고. 그래서 그것이 제가 매크로를 쓰고있는 이유입니다.
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:\Users\hamanda\Desktop\B2_images\"
' 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)) = ".png" 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
을 이제 내가 시험이
나는 그것을 시도거야, 그리고 내가 실행했습니다 당신이 – ayaan
을 알려주세요 런타임 오류 424를주는 코드 : 필요한 개체. HOW는 그 – ayaan
을 해결하기 위해 f9를 사용하는 코드를 사용하고 계십니까? 그렇다면 어디에서 오류가 발생합니까? –