G
Guest
I am into PowerPoint Automation.
What I have to do is to store all the custom animation (main sequence) in
memory and then delete the custom animations. The do some operations on
powerpoint (some custom operations) and then write back the original custom
animation (main sequence) back to the slides.
I was initially trying with one slide. I was trying to: 1.) Read
Mainsequence 2.) Delete MaineSequence 3.) Rewrite the mainsequence to the
slide. This is the code:
***************************************
Public MainSequenceItems() As Effect
Public MSItemsCount As Long
Public count As Integer
Public i As Long
Sub test()
Dim k As Long
Dim j As Long
'ReadTimelineItems
With ActivePresentation.Slides(1)
ReDim MainSequenceItems(.TimeLine.MainSequence.count)
For i = 1 To .TimeLine.MainSequence.count
Set MainSequenceItems(i) = .TimeLine.MainSequence.Item(i)
Next
End With
'DeleteMainSequence
With ActivePresentation.Slides(1)
For j = 1 To (i - 1)
.TimeLine.MainSequence.Item(1).Delete
Next
End With
'ReassignmainSequence
With ActivePresentation.Slides(1)
For k = 1 To (i - 1)
Set .TimeLine.MainSequence.Item(k) = MainSequenceItems(k)
Next
End With
End Sub
****************************************************
So, I originally stored all the items of mainsequence in the
MainSequenceItems( ) (while reading the mainsequence). But, when I delete the
main sequence my array MainSequenceItems( ) gets cleared too. So, when I go
to reassign the mainsequence back to slide it gives me error that there is no
object present.
So, can anyone help me in this. I want to do just 3 things:
1.) Read the Mainsequence (that I did, hopefully correctly. if not then
please correct me)
2.) Delete the mainsequence.
3.) Rewrite/reassign the mainsequence back to the slide.
Thanks in advance.
What I have to do is to store all the custom animation (main sequence) in
memory and then delete the custom animations. The do some operations on
powerpoint (some custom operations) and then write back the original custom
animation (main sequence) back to the slides.
I was initially trying with one slide. I was trying to: 1.) Read
Mainsequence 2.) Delete MaineSequence 3.) Rewrite the mainsequence to the
slide. This is the code:
***************************************
Public MainSequenceItems() As Effect
Public MSItemsCount As Long
Public count As Integer
Public i As Long
Sub test()
Dim k As Long
Dim j As Long
'ReadTimelineItems
With ActivePresentation.Slides(1)
ReDim MainSequenceItems(.TimeLine.MainSequence.count)
For i = 1 To .TimeLine.MainSequence.count
Set MainSequenceItems(i) = .TimeLine.MainSequence.Item(i)
Next
End With
'DeleteMainSequence
With ActivePresentation.Slides(1)
For j = 1 To (i - 1)
.TimeLine.MainSequence.Item(1).Delete
Next
End With
'ReassignmainSequence
With ActivePresentation.Slides(1)
For k = 1 To (i - 1)
Set .TimeLine.MainSequence.Item(k) = MainSequenceItems(k)
Next
End With
End Sub
****************************************************
So, I originally stored all the items of mainsequence in the
MainSequenceItems( ) (while reading the mainsequence). But, when I delete the
main sequence my array MainSequenceItems( ) gets cleared too. So, when I go
to reassign the mainsequence back to slide it gives me error that there is no
object present.
So, can anyone help me in this. I want to do just 3 things:
1.) Read the Mainsequence (that I did, hopefully correctly. if not then
please correct me)
2.) Delete the mainsequence.
3.) Rewrite/reassign the mainsequence back to the slide.
Thanks in advance.