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.
Shyam Pillai - 13 Nov 2006 16:07 GMT
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.

Signature
Regards,
Shyam Pillai
Image Importer Wizard
http://skp.mvps.org/iiw.htm
>I am into PowerPoint Automation and created plugins for PPT 2002 & 2003.
>Now,
[quoted text clipped - 49 lines]
>
> This is urgent. Thanks a lot in advance.
Shyam Pillai - 13 Nov 2006 16:39 GMT
FYI - I am using the final RTM release and not the beta build.

Signature
Regards,
Shyam Pillai
Image Importer Wizard
http://skp.mvps.org/iiw.htm
> Hi,
> I am unable to reproduce the error. I tried to access the properties prior
[quoted text clipped - 55 lines]
>>
>> This is urgent. Thanks a lot in advance.
technoknight - 14 Nov 2006 02:45 GMT
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.
> FYI - I am using the final RTM release and not the beta build.
>
[quoted text clipped - 57 lines]
> >>
> >> This is urgent. Thanks a lot in advance.
Shyam Pillai - 14 Nov 2006 04:40 GMT
Yes, I was accessing it from an external application.

Signature
Regards,
Shyam Pillai
Animation Carbon
http://www.animationcarbon.com
> Hello Shyam,
>
[quoted text clipped - 81 lines]
>> >>
>> >> This is urgent. Thanks a lot in advance.