Automation: MainSequence Problem.

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.
 
A

Austin Myers

If it were me, I think I would write the information to a "Tag". In that
way it won't be dumped when you delete the main sequence. Simply read the
"Tag" back when your ready to put it back in place. (Each object, including
the slide itself can have a Tag and they are a handy place to store
information.)

Austin Myers
MS PowerPoint MVP Team

PowerPoint Video and PowerPoint Sound Solutions www.pfcmedia.com
 
G

Guest

We can do this but I have to store the information about mainsequence items.
1.) I don't know the number of items in mainsequence. I can count it but
then I would like to have an array of tags but I don't think that we can use
tags in array form.
2.) If I try to make one tag for each property then I will have to write a
lot of tags since there can be many items in the mainsequence and I will have
to record each and every information regading that item viz. effecttype,
triggers, timings etc. So, it will too much of information to be recorded.
Also this all has to be done dynamically as per the number of items in
mainsequene. Do you think this will be a good feasible idea?

Please suggest.

Thanks.
 
B

Brian Reilly, MVP

Austin, you devil. How intelligent of you to suggest the use of tags.
You learn quickly (g).

TechnoKnight,
The use of tags would not tax memory or be hard to do. You can also do
it dynamically with the shapes.count property on any number of slides.
Brian Reilly, MVP
 
S

Steve Rindsberg

I'm not sure of this, not having tried it before, but it seems that in storing
timeline effects in an array you're storing references to objects; when you
later delete those objects, the references in the array are no longer valid.

I think that's why you're seeing empty values.

Instead, I suspect you'd want to store the properties of the effects, not the
effects themselves; you could define e.g. an EffectProperties UDT and store an
array of UDTs, for example.
 
G

Guest

I can use the tags but there will be lot of information that I wil have to
store for each mainsequence item, like effecttype, exit, index, aftereffect,
dim settings, playsetting, sound effect and lot of other properties. There
are lot other properties that I will have to store and then later on retrieve
them back and assign them. Also, there are some properties those are read
only, like index. I won't be able to assign Index any value.

One more concern is that if I don't save "effect" then how will I rebuild
the mainsequence. My idea was to just save the original mainsequence items
list as it is with all the properties and then write them back to
mainsequence later on. But, if I don't save the "effects list" then how will
I recreate the original mainsequence?

Thanks.
 
S

Steve Rindsberg

Somebody who's done a lot more with animation will have to help you with that one,
I'm afraid. I'm out of my depth. :-(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top