Linking to a file with 2007

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I have this code in a macro that worked in 2003, I think it was copied from a
recorded macro.

ActiveWindow.Selection.SlideRange.Shapes _
.AddPicture(FileName:=PhotoName, _
LinkToFile:=msoTrue, _
SaveWithDocument:=msoFalse, _
Left:=0, _
Top:=0, _
Width:=720, _
Height:=540).Select

This fails with 2007 with "Shape (unknown member) : Invalid request. To
select a shape, its view must be active."

The document is linked into the presentation even with the error.

How can I rewrite this statement.

Thanks
Tom
 
This is part of a series of macros that load all of the files in a folder.
The slide was created by a macro which then tries to link an image to the
slide. Nothing was clicked on except the initial macro. This code will run
with 2003 but not in 2007. What is different?

thanks
 
Why do you need to select the added picture (the last .select)?

I would never rely on .select and selections in 2003 or 2007 code unless I
really had to (virtually never) If you post all the code maybe someone will
look at it but if it all came from the recorder I would get a coder to
rewrite it for you if you use it often. The recorder nearly always produces
very dodgy code in PowerPoint.


--

Amazing PPT Hints, Tips and Tutorials

http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html

email john AT technologytrish.co.uk
 
Back
Top