Not sure if you are using VB.Net or C# so I will explain it using VBA code. You can easily adapt it to your code. To get the filename you have to ensure that you do not just ' Insert' the image but ' Insert And Link' See the below screenshot. Remember MS-PP will rename the picture to ' Picture 1, Picture 2' etc in this case as well but then you can always use LinkFormat.SourceFullName to get the full Filename + Path. Quite a few things that should work (and do in the Win versions) fail in Mac PPT, unfortunately. The last two -1 parameters tell PPT to bring the picture in at 'natural' size. Ie, whatever size it'd normally insert the image if you did it manually; this avoids distorting the image. ![]() ![]() And once you have that, you can easily retrieve the file name. See this example Option Explicit Sub Sample() Dim img As Shape For Each img In ActivePresentation.Slides(1).Shapes '~~> Type is 11 when you insert and link an image If img.Type = msoLinkedPicture Then Debug.Print img.LinkFormat.SourceFullName Debug.Print img.Name End If Next End Sub SCREENSHOT.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |