PowerPoint 2007 Beta Automation Problem.

T

technoknight

I am into PowerPoint Automation and created plugins for PPT 2002 & 2003. Now,
I am trying to amend an exitsing plugin to make it work with PPT 2007.

I have created custom toolbars inside PowerPoint and on clicking them I am
calling functions from a dll file. In one part of the dll I have a function
which creates a copy of the existing one by doing a "SaveCopyAs" & then
opening up the copy using the Open method. The code is:

Public Sub ShowAnimatorDialogBox()

Public App_ As PowerPoint.Application
Dim sTempFile As String

Set App_ = CreateObject("PowerPoint.Application")
sTempFile = "c:\temp.ppt"

' save a copy of the original file
Call App_.ActivePresentation.SaveCopyAs(sTempFile)

' Open the copy
App_.Presentations.Open sTempFile, , False

End Sub

-----------------------------------------------------------------
Suppose, I have a 2 slide presentation with title & body text layout. Now, I
want to access some properties of
ActivePresentation.Slides(2).Shapes(1).TextFrame.TextRange. These properties
are BoundLeft, BoundWidth etc. Before making the copy of the existing PPT I
have right values. But, as soon as I create a copy all the properties under
ActivePresentation.Slides(2).Shapes(2).TextFrame.TextRange change to
<Application defined or Object Defined Error>.

When I do the same in the VBA part then it shows me the values but when I
execute this code in the dll then the values are not availble and, hence, I
encounter an Automation Error. This code works fine in the dll for PPT 2002 &
2003 but for 2007 it is failing.

Can anyone please help me by telling me what exactly is happening here? Why
the values changes to errors just when I make the copy? What can I do to get
rid of this error?

This is urgent. Thanks a lot in advance.
 
S

Shyam Pillai

Hi,
I am unable to reproduce the error. I tried to access the properties prior
to calling your routine and accessed then after calling your routine and
they working fine on my machine.


--
Regards,
Shyam Pillai

Image Importer Wizard
http://skp.mvps.org/iiw.htm
 
T

technoknight

Hello Shyam,

I just wanted to confirm again that you were trying to access the properties
through an external application and not the PowerPoint VBA. Am I right ?

Becoz, when I try to access it using PowerPoint VBA then I can access but
not through the external Application.

I am not sure how different Beta & TMV Release versions can be but, in the
mean time, I will try to get RTM Release and test on it too.

Thanks a lot for your help.
 

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