NaB
08-04-2021, 03:02 PM
Good night, I'm new here...
I have a doubt about vba PowerPoint. I have written a line of code that opens a picture obtained from my hard drive.
Sub OpenPicture()
Set MyDocument=ActivePresentation.Slides(1)
MyDocument.Shapes.AddPicture Filename:="D:\User\Desktop\Prueba.jpg", LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, Left:=100, Top:=100, Width:=270, Height:=270
End Sub
The code runs ok but the system gives a random name for the picture and ]I don't know how to rename it so I can manipulate it later.
PS: Apologies for my English,
Thank you very much for your help.
I have a doubt about vba PowerPoint. I have written a line of code that opens a picture obtained from my hard drive.
Sub OpenPicture()
Set MyDocument=ActivePresentation.Slides(1)
MyDocument.Shapes.AddPicture Filename:="D:\User\Desktop\Prueba.jpg", LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, Left:=100, Top:=100, Width:=270, Height:=270
End Sub
The code runs ok but the system gives a random name for the picture and ]I don't know how to rename it so I can manipulate it later.
PS: Apologies for my English,
Thank you very much for your help.