|
将图片统一设成幻灯片的背景时,请用以下过程:
Sub AutoFillBackGround()
With Application.FileSearch
.NewSearch
'在下一行双引号中输入图片文件夹位置
.LookIn = "c:Documents and SettingsXXMy DocumentsMy Pictures"
.FileName = "*.jpg" '在左边双引号中输入图片类型
Dim i As Single
If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
ActivePresentation.Slides.Add i, ppLayoutBlank
ActivePresentation.Slides(i).Select
With ActiveWindow.Selection.SlideRange
.FollowMasterBackground = msoFalse
.DisplayMasterShapes = msoTrue
With .Background
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(255, 255, 255)
.Fill.BackColor.SchemeColor = ppAccent1
.Fill.Transparency = 0#
.Fill.UserPicture Application.FileSearch.FoundFiles(i)
End With
End With
Next i
End If
End With
End Sub |
|