Sal Paradise
Well-known Member
- Joined
- Oct 23, 2006
- Messages
- 2,457
I have created an add-in that will add disclaimers to all powerpoint presentations in a folder for a specific customer. All was working well until I decided to try to animate it. Before it would run in about 2-3 seconds per presentation, but as soon as the commented lines below are uncommented, the screen keeps refreshing 4 times per slide showing the slide animation preview (taking many more seconds).
I've tried this site's code to see if I could cut out screen updating, but that was a giant failure. I also tried to Open with "WithWindow:=False" but I can't seem to use that while having all the with statements work. I suppose if I could get that to work, it may solve my problems, but regardless I would love it if someone had some way of fixing it.
I am running Office 2000 on XP if it matters.
Here is the code:
I've tried this site's code to see if I could cut out screen updating, but that was a giant failure. I also tried to Open with "WithWindow:=False" but I can't seem to use that while having all the with statements work. I suppose if I could get that to work, it may solve my problems, but regardless I would love it if someone had some way of fixing it.
I am running Office 2000 on XP if it matters.
Here is the code:
Code:
Sub ChangeDisclaimer(strMyFile As String, CustName As String)
Dim oPresentation As Presentation
Set oPresentation = Presentations.Open(strMyFile)
With oPresentation
Dim oSl As Slide
For Each oSl In ActivePresentation.Slides
On Error Resume Next
oSl.Shapes("Disclaimer").Delete
On Error GoTo 0
oSl.Shapes.AddTextbox(msoTextOrientationHorizontal, 108#, 515#, 504#, 24#).Name = "Disclaimer"
With oSl.Shapes.Range("Disclaimer")
.Align msoAlignBottoms, True
.Align msoAlignCenters, True
.TextFrame.WordWrap = msoTrue
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.RGB = RGB(255, 255, 255)
.Line.Visible = msoTrue
.Line.ForeColor.RGB = RGB(0, 0, 0)
.Line.BackColor.RGB = RGB(0, 0, 0)
End With
With oSl.Shapes("Disclaimer").TextFrame.TextRange
.Paragraphs(Start:=1, Length:=1).ParagraphFormat.Alignment = ppAlignCenter
.Text = "Don't do bad stuff "&CustName
With .Font
.NameAscii = "Arial"
.Size = 7
.BaselineOffset = 0
.Shadow = msoFalse
.Bold = msoTrue
.Color.RGB = RGB(0, 0, 0)
End With
End With
' With oSl.Shapes("Disclaimer").AnimationSettings
' .EntryEffect = ppEffectAppear
' .AnimateBackground = msoTrue
' .AnimationOrder = 1
' .AdvanceMode = ppAdvanceOnTime
' End With
Next oSl
End With
oPresentation.Save
oPresentation.Close
End Sub