Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get the source path and filename from image with vba?

1,130 views
Skip to first unread message

Shyam Pillai

unread,
Aug 22, 2001, 5:58:26 AM8/22/01
to
Tom,

I use the following routine regularly.

' ----- Beginning of Code -----
Function GetSourceInfo( oShp As Shape) As String
On Error GoTo Error_GetSourceInfo
GetSourceInfo= oShp.LinkFormat.SourceFullName
Exit Function
Error_GetSourceInfo:
GetSourceInfo = ""
End Function

Sub Test()
Dim oShape as Shape
Set oShape = ActivePresentation.Slides(1).Shapes(1)
Debug.Print GetSourceInfo(oShape)
End Sub
' ----- End Of Code -----

The function returns a blank if it is not a linked object else it
returns the link information

Regards
Shyam Pillai

http://www.mvps.org/skp

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

On 22 Aug 2001 08:31:36 +0200, Tom Glasauer <tom.gl...@web.de> made
the following post:

>Hello,
>
>
>I have inserted an image in a presentation. I can read its name with
>
>
>ActivePresentation.Slides(1).Shapes(1).name
>
>
>Is it possible than I can detect the source path and filename from which I have
>inserted the image?
>
>
>Thanx
>
>
>Tom

Tom Glasauer

unread,
Aug 22, 2001, 6:11:03 AM8/22/01
to
Shyam,


I tried your code but I got the following error:


"LinFormat (unknown member): Invalid request. This operation requires a linked
object."


So, why does this not work with images? How can I make an image a "linked
object"?


Tom

--
__________________________________________________________
News suchen, lesen, schreiben mit http://newsgroups.web.de

Steve Rindsberg

unread,
Aug 22, 2001, 8:42:36 AM8/22/01
to
> So, why does this not work with images? How can I make an image a "linked
> object"?

It does, but only with linked images. Ordinarily, PPT doesn't link images
(be thankful for that), it embeds them, so there's no reason for it to
retain the source information.


Shyam Pillai

unread,
Aug 22, 2001, 8:57:26 AM8/22/01
to
Tom,

Could you post your code? The code is posted is a generic wrapper that
I've always used without any issues.


Regards
Shyam Pillai

http://www.mvps.org/skp

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

On 22 Aug 2001 12:11:03 +0200, Tom Glasauer <tom.gl...@web.de> made

Tom Glasauer

unread,
Aug 22, 2001, 9:00:24 AM8/22/01
to
Shyam,


when I insert an image with "link" activated (I'm working with the german
version, so the name could be an other), your code is working.


thanx.


Tom

--

Shyam Pillai

unread,
Aug 22, 2001, 9:17:10 AM8/22/01
to
Tom,
The function will return a path only if the shape has linked information -
linked sounds, linked media, linked ole, linked images.

--
Regards
Shyam Pillai

http://www.mvps.org/skp


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

__________________________________________________
"Tom Glasauer" <tom.gl...@web.de> wrote in message
news:3b83ace8$1...@netnews.web.de...

Harry Hood

unread,
Aug 22, 2001, 12:23:21 PM8/22/01
to
Is there a way to get information on objects without VBA? Paths, size,
etc.?

Thanks.

Harry Hood


"Shyam Pillai" <Sh...@Asia.com> wrote in message
news:uzqHZwwKBHA.1984@tkmsftngp05...

Shyam Pillai

unread,
Aug 22, 2001, 1:25:56 PM8/22/01
to
Harry,
You could use my new add-in Analyzer, will be out later this week.

Regards
Shyam Pillai

http://www.mvps.org/skp

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

On Wed, 22 Aug 2001 09:23:21 -0700, "Harry Hood"
<hooda...@hotmail.com> made the following post:

Steve Rindsberg

unread,
Aug 22, 2001, 1:48:32 PM8/22/01
to
Piggie ( http://www.rdpslides.com/pptools/ ) will tell you some of that
stuff.
Shyam's Analyzer will give more complete details

--
Steve Rindsberg, PowerPoint MVP
Got a PowerPoint wish/suggestion/beef?
Email msw...@microsoft.com with PowerPoint in the subject line
Get the PPT FAQs at http://www.rdpslides.com/pptfaq/
RnR PPTools - http://www.rdpslides.com/pptools/
------
Harry Hood <hooda...@hotmail.com> wrote in message
news:em2eabyKBHA.2012@tkmsftngp02...

0 new messages