Shapes addpicture
Автор Ольга Бартунская задал вопрос в разделе Другие языки и технологии
Программирование в PowerPoint и получил лучший ответ
Ответ от Imobilazer[гуру]
А картинки то в нужной папке есть?
Ответ от Марк Твенсис[гуру]
Private Sub CommandButton1_Click()
Dim oApp As New PowerPoint.Application
oApp.Activate
oApp.Visible = msoTrue
Dim oPresent As PowerPoint.Presentation
Set oPresent = oApp.Presentations.Add()
Dim oFSO As New Scripting.FileSystemObject
Dim oFolder As Scripting.Folder
Dim oFile As Scripting.File
Set oFolder = oFSO.GetFolder("D:Slides")
For Each oFile In oFolder.Files
Next
Dim nCounter As Integer
nCounter = 1
For Each oFile In oFolder.Files
Set oSlide = oApp.ActivePresentation.Slides.Add(nCounter, ppLayoutBlank)
'MsgBox oFile.Name
nCounter = nCounter + 1
Next
oSlide.Shapes.AddPicture oFileName:="D:Slides" +& oFile.Name, LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=10, Top:=10, Width:=700, Height:=520
'oFile.Delete
Private Sub CommandButton1_Click()
Dim oApp As New PowerPoint.Application
oApp.Activate
oApp.Visible = msoTrue
Dim oPresent As PowerPoint.Presentation
Set oPresent = oApp.Presentations.Add()
Dim oFSO As New Scripting.FileSystemObject
Dim oFolder As Scripting.Folder
Dim oFile As Scripting.File
Set oFolder = oFSO.GetFolder("D:Slides")
For Each oFile In oFolder.Files
Next
Dim nCounter As Integer
nCounter = 1
For Each oFile In oFolder.Files
Set oSlide = oApp.ActivePresentation.Slides.Add(nCounter, ppLayoutBlank)
'MsgBox oFile.Name
nCounter = nCounter + 1
Next
oSlide.Shapes.AddPicture oFileName:="D:Slides" +& oFile.Name, LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=10, Top:=10, Width:=700, Height:=520
'oFile.Delete
Ответ от 3 ответа[гуру]
Привет! Вот подборка тем с ответами на Ваш вопрос: Программирование в PowerPoint