Unable to change object link in PPT 2007

G

Guest

After shamelessly copying code from Steve's FAQ, I was delighted to be able
to change media link targets with a vba macro in PowerPoint -- worked like a
champ.

I am now in PPT 2007, and the same code seems to fail in a peculiar way:

After getting the user to enter a new link filename, I am attempting to
execute this statement:

ActiveWindow.Selection.ShapeRange(1).linkformat.sourcefullname = [new link
target]

In the debugger, sourcefullname is shown as a member of linkformat, and I
have checked and rechecked that all the files are named correctly and are in
the places where the paths say they are.

Here's the error:

LinkFormat (unknown member) failed

What can I do (if anything) to get around this? Is there some other member
in 2007 that I ought to be updating?

Thanks.
 
G

Glen Millar

Dave,

The old "code from 2003 to 2007 trap" <g>.

Run to the window and holler "Oh, Steve"! he will be around at some time,
and he is very good at checking posts.

--

Regards,
Glen Millar
Microsoft PPT MVP

Tutorials and PowerPoint animations at
the original www.pptworkbench.com
glen at pptworkbench dot com
 
S

Steve Rindsberg

Dave Jenkins said:
After shamelessly copying code from Steve's FAQ, I was delighted to be able
to change media link targets with a vba macro in PowerPoint -- worked like a
champ.

I am now in PPT 2007, and the same code seems to fail in a peculiar way:

After getting the user to enter a new link filename, I am attempting to
execute this statement:

ActiveWindow.Selection.ShapeRange(1).linkformat.sourcefullname = [new link
target]

In the debugger, sourcefullname is shown as a member of linkformat, and I
have checked and rechecked that all the files are named correctly and are in
the places where the paths say they are.

Here's the error:

LinkFormat (unknown member) failed

What can I do (if anything) to get around this? Is there some other member
in 2007 that I ought to be updating?

What does the link point to? If it's e.g. a chart (ie, created in and linked
to Excel 2007) MS hasn't quite finished the code, alas; the object isn't
revealed to PPT, so you can't change the source.

OTOH, when I browsed and linked to an existing XLS, I was able to change the
link using the same code.
 
G

Guest

Hello,
I am also experiencing the same problem
I cannot set a new value for the LinkFormat.SourceFullname property in
PowerPoint 2007.

This is what I have done:

1. Inserted a AVI movie object to the slide thru the Insert menu.

2. The slide has only one shape (the AVI movie shape).

3. I tried to change the linked file path using
ActivePresentation.Slides(1).Shapes(1).LinkFormat.SourceFullName =
"sample.avi"

This statement throws error. How can we set the new value?
(But the above code is working in PowerPoint 2003 and PowerPoint 2002).

Steve Rindsberg said:
Dave Jenkins said:
After shamelessly copying code from Steve's FAQ, I was delighted to be able
to change media link targets with a vba macro in PowerPoint -- worked like a
champ.

I am now in PPT 2007, and the same code seems to fail in a peculiar way:

After getting the user to enter a new link filename, I am attempting to
execute this statement:

ActiveWindow.Selection.ShapeRange(1).linkformat.sourcefullname = [new link
target]

In the debugger, sourcefullname is shown as a member of linkformat, and I
have checked and rechecked that all the files are named correctly and are in
the places where the paths say they are.

Here's the error:

LinkFormat (unknown member) failed

What can I do (if anything) to get around this? Is there some other member
in 2007 that I ought to be updating?

What does the link point to? If it's e.g. a chart (ie, created in and linked
to Excel 2007) MS hasn't quite finished the code, alas; the object isn't
revealed to PPT, so you can't change the source.

OTOH, when I browsed and linked to an existing XLS, I was able to change the
link using the same code.

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 
S

Steve Rindsberg

Hello,
I am also experiencing the same problem
I cannot set a new value for the LinkFormat.SourceFullname property in
PowerPoint 2007.

This is what I have done:

1. Inserted a AVI movie object to the slide thru the Insert menu.

2. The slide has only one shape (the AVI movie shape).

3. I tried to change the linked file path using
ActivePresentation.Slides(1).Shapes(1).LinkFormat.SourceFullName =
"sample.avi"

This statement throws error. How can we set the new value?
(But the above code is working in PowerPoint 2003 and PowerPoint 2002).

First make sure that the file's been saved once and that sample.avi is in the same
folder as the file. If the file's not where the link points, PPT won't let you
link to it (though in pre-2007 versions, it wouldn't throw errors, it'd just ignore
you).
Steve Rindsberg said:
Dave Jenkins said:
After shamelessly copying code from Steve's FAQ, I was delighted to be able
to change media link targets with a vba macro in PowerPoint -- worked like a
champ.

I am now in PPT 2007, and the same code seems to fail in a peculiar way:

After getting the user to enter a new link filename, I am attempting to
execute this statement:

ActiveWindow.Selection.ShapeRange(1).linkformat.sourcefullname = [new link
target]

In the debugger, sourcefullname is shown as a member of linkformat, and I
have checked and rechecked that all the files are named correctly and are in
the places where the paths say they are.

Here's the error:

LinkFormat (unknown member) failed

What can I do (if anything) to get around this? Is there some other member
in 2007 that I ought to be updating?

What does the link point to? If it's e.g. a chart (ie, created in and linked
to Excel 2007) MS hasn't quite finished the code, alas; the object isn't
revealed to PPT, so you can't change the source.

OTOH, when I browsed and linked to an existing XLS, I was able to change the
link using the same code.

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 
G

Guest

Thank you Steve for the reply.

Sorry that I could not put down my requirement in proper way. But your
answer helped me solve my issue.

My requirement was this;

Change the absolute link path to relative link path for the inserted video
files in PowerPoint so that I can copy the PPT and the Video in one folder
and make it play on another PC.

But now I realized that we do not need to change the link format to achieve
my requirement. Just copying the video and the PPT to the same folder will do.

Thank you


Steve Rindsberg said:
Hello,
I am also experiencing the same problem
I cannot set a new value for the LinkFormat.SourceFullname property in
PowerPoint 2007.

This is what I have done:

1. Inserted a AVI movie object to the slide thru the Insert menu.

2. The slide has only one shape (the AVI movie shape).

3. I tried to change the linked file path using
ActivePresentation.Slides(1).Shapes(1).LinkFormat.SourceFullName =
"sample.avi"

This statement throws error. How can we set the new value?
(But the above code is working in PowerPoint 2003 and PowerPoint 2002).

First make sure that the file's been saved once and that sample.avi is in the same
folder as the file. If the file's not where the link points, PPT won't let you
link to it (though in pre-2007 versions, it wouldn't throw errors, it'd just ignore
you).
Steve Rindsberg said:
After shamelessly copying code from Steve's FAQ, I was delighted to be able
to change media link targets with a vba macro in PowerPoint -- worked like a
champ.

I am now in PPT 2007, and the same code seems to fail in a peculiar way:

After getting the user to enter a new link filename, I am attempting to
execute this statement:

ActiveWindow.Selection.ShapeRange(1).linkformat.sourcefullname = [new link
target]

In the debugger, sourcefullname is shown as a member of linkformat, and I
have checked and rechecked that all the files are named correctly and are in
the places where the paths say they are.

Here's the error:

LinkFormat (unknown member) failed

What can I do (if anything) to get around this? Is there some other member
in 2007 that I ought to be updating?

What does the link point to? If it's e.g. a chart (ie, created in and linked
to Excel 2007) MS hasn't quite finished the code, alas; the object isn't
revealed to PPT, so you can't change the source.

OTOH, when I browsed and linked to an existing XLS, I was able to change the
link using the same code.

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 
S

Steve Rindsberg

Thank you Steve for the reply.

Sorry that I could not put down my requirement in proper way. But your
answer helped me solve my issue.

My requirement was this;

Change the absolute link path to relative link path for the inserted video
files in PowerPoint so that I can copy the PPT and the Video in one folder
and make it play on another PC.

But now I realized that we do not need to change the link format to achieve
my requirement. Just copying the video and the PPT to the same folder will do.

Sometimes yes, sometimes no.

As long as you put the video and the PPT in the same folder BEFORE inserting the video,
then LinkFormat.SourceFullname will include just the filename of the video, no path.
Then PPT will look for it in the current directory, which is almost always the directory
where the PPT is.
Thank you

Steve Rindsberg said:
Hello,
I am also experiencing the same problem
I cannot set a new value for the LinkFormat.SourceFullname property in
PowerPoint 2007.

This is what I have done:

1. Inserted a AVI movie object to the slide thru the Insert menu.

2. The slide has only one shape (the AVI movie shape).

3. I tried to change the linked file path using
ActivePresentation.Slides(1).Shapes(1).LinkFormat.SourceFullName =
"sample.avi"

This statement throws error. How can we set the new value?
(But the above code is working in PowerPoint 2003 and PowerPoint 2002).

First make sure that the file's been saved once and that sample.avi is in the same
folder as the file. If the file's not where the link points, PPT won't let you
link to it (though in pre-2007 versions, it wouldn't throw errors, it'd just ignore
you).
:

After shamelessly copying code from Steve's FAQ, I was delighted to be able
to change media link targets with a vba macro in PowerPoint -- worked like a
champ.

I am now in PPT 2007, and the same code seems to fail in a peculiar way:

After getting the user to enter a new link filename, I am attempting to
execute this statement:

ActiveWindow.Selection.ShapeRange(1).linkformat.sourcefullname = [new link
target]

In the debugger, sourcefullname is shown as a member of linkformat, and I
have checked and rechecked that all the files are named correctly and are in
the places where the paths say they are.

Here's the error:

LinkFormat (unknown member) failed

What can I do (if anything) to get around this? Is there some other member
in 2007 that I ought to be updating?

What does the link point to? If it's e.g. a chart (ie, created in and linked
to Excel 2007) MS hasn't quite finished the code, alas; the object isn't
revealed to PPT, so you can't change the source.

OTOH, when I browsed and linked to an existing XLS, I was able to change the
link using the same code.

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 

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