Jump to content

Replace an image (or audio) A with an image (or sound) B that retains the effect in powerpoint


Matyo
 Share

Recommended Posts

Hello everybody,

I'm trying to try to replace an image A (or an audio A) with an image B (or a sound B ) that still has the same effects (properties, ..) set earlier in a silde's powerpoint without knowing how?

Describe in the attached picture.

Please help everyone.

Thanks everyone!

 

2017-09-24_22-59-37.png

2017-09-24_22-59-25.png

Edited by Matyo
Link to comment
Share on other sites

Well, from what quick research I did, it looks possible using VBA, so I would suspect you could use PowerPoint COM to accomplish the tasks.  I'd recommend finding a piecemeal way to accomplish what you want using VBA first, then port the code to AutoIt (that's how I'd approach it).

Link to comment
Share on other sites

I haven't found a way to replace a picture/sound file with another file and keep all properties. The properties are gone when deleting the original picture/sound file.

@spudw2k
Can you please post a link to one of the VBA examples you mention?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Link to comment
Share on other sites

That's the post I found as well. All other results presented by Google did the "swap" the same way - means they loose all properties the script does not save in advance and sets them after inserting the new shape.
There are a lot of properties you can set for a shape as described on MSDN.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

6 hours ago, spudw2k said:

This was he first one I found: https://social.msdn.microsoft.com/Forums/en-US/39eb7cf4-2e85-4010-8e6a-10da20b352f7/replacing-changing-the-pictures-in-powerpoint-presentation?forum=isvvba

I notice in this example it's not doing a straight swap, but it is capturing properties (specifically location and size) and re-assigning them to the new image.  What properties are you talking about?  

Hi Spudw2k,

Is there no way to replace it directly? An object has a lot of attributes such as effects, animation, order of presentation ... so go set up each component attribute, I think not perfect.

Link to comment
Share on other sites

Use the AddPicture method to add the picture. Set LinkToFile to msoTrue and SaveWithDocument to msoFalse. Replace the file with the new picture (the name needs to remain unchanged) and you are set.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...