+ Reply to Thread
Results 1 to 4 of 4

Deleting PowerPoint Slides or Text Boxes Only When Specific Text is Present

  1. #1
    Registered User
    Join Date
    01-29-2019
    Location
    West Des Moines, Iowa
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    1

    Deleting PowerPoint Slides or Text Boxes Only When Specific Text is Present

    Hello. This is my first post and I'm not a computer person so please be gentle!

    I have a sprawling PowerPoint slide deck that we use as a template which users can customize or rearrange the slides as needed for the situation. Many slides are only needed for certain clients or situations so our system is to have a text box on the variable slides that read "[Only for Clients with Product A]", "[Only for Clients with Product B]", and so on. When an employee needs to customize the template they then need to manually go through the PowerPoint and delete the slides not meant for that situation and then delete only the text boxes on the slides that should be kept. This works well enough but is very time consuming and is vulnerable to user error, as I'm sure you can imagine.

    What I would like to do, but don't know how, is to build a macro in excel (not PowerPoint) which would do the following:
    1. Open the PowerPoint template. Let's say it is found at M:Presentations/Template5.ppt.
    2. Conduct a Find-and-Replace-All sequence where it replaces all instances of "[Only for Clients with Product A]" with the phrase "[Delete this Text Box]".
    3. Conduct a Find-and-Replace-All sequence where it replaces all instances of "[Only for Clients with Product B]" with the phrase "[Delete this Slide]".
    4. Search through the slides and in each case where it finds "[Delete this Slide]" it deletes that specific slide.
    5. Search through the slides and in each case where it finds "[Delete this Text Box]" it deletes (or hides) the text box.

    Importantly, if there is a way to do this without knowing the exact slide number that would be ideal. I do not want to have to go into the macro to update it every time a slide is added or deleted from the master template, which makes more work that may be worth it.

    Is what I am needing even possible? have you done this? Or is there a better way to do this, perhaps through shapes or symbols rather than text boxes (or if necessary, with Sections)? My limited experience with finding and replacing text and finding and deleting Bookmarks in Word Documents using Excel Macros tells me that this should be possible, but I am new to doing this with PowerPoint objects and am stumped.

    Anything any of you can do to help me on the right track would be most appreciated. Thanks for your help, and please let me know if you have any questions. In case it matters we use Microsoft Office Professional Plus 2019, Version 1808.

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Deleting PowerPoint Slides or Text Boxes Only When Specific Text is Present

    hey! I'm only 2 hours away from you. wanna go for tea after the holiday? LOL. so.....

    you said:
    if there is a way to do this without knowing the exact slide number that would be ideal.
    of course you can. slides are objects. all objects in every program have properties called count. you use it for the purpose of looping through the slides in your case.

    you said:
    Or is there a better way to do this, perhaps through shapes or symbols rather than text boxes (or if necessary, with Sections)?
    IMO, absolutely not shapes, symbols or sections. textboxes are extremely simple. the others are not as simple.

    your office version is completely irrelevant because outlook doesn't change much between versions, just like all office products don't. the only thing MS ever changes is the interface, and they always advertise it as so innovative after every single release.

    what you want to do is a lot of work, and I would guess you wouldn't find anyone here that would post the code to do exactly what you want for free. Not to mention that there are not many questions posted on this board in the outlook section. I've honestly never seen anyone but me respond to questions in this section. Maybe a couple of other folks.

    you also said:
    I'm not a computer person so please be gentle!
    well if you are in charge of anything programming related or you are in your IT dept, it might help if you learned some basic programming techniques. here are some things to start with:

    https://en.wikipedia.org/wiki/Object_model

    http://what-when-how.com/excel-vba/i...-object-model/

    https://www.dummies.com/software/mic...-object-model/

    and MS is very well known for it's heavily used COM architecture. this is it:

    https://docs.microsoft.com/en-us/win...t-object-model

    it applies to all its office products. here is excel's object model:

    https://docs.microsoft.com/en-us/off...l/object-model

    and powerpoint's:

    https://docs.microsoft.com/en-us/off...k/object-model

    perhaps you could try to begin and then ask specific questions of folks here when they come up?
    Last edited by vba_php; 11-26-2020 at 11:08 AM.

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,084

    Re: Deleting PowerPoint Slides or Text Boxes Only When Specific Text is Present

    Hi,

    Give this a try, please:

    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Registered User
    Join Date
    10-06-2020
    Location
    Cologne, Germany
    MS-Off Ver
    Microsoft Office 2020
    Posts
    15

    Re: Deleting PowerPoint Slides or Text Boxes Only When Specific Text is Present

    xlntiwit thanks you for the answer. We have a similar issue in the office. Guys tried your method and it is working, thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy all text boxes (from all slides) in to one slide / insert Video background
    By nagesh.tvsr in forum PowerPoint Formatting & General
    Replies: 0
    Last Post: 11-13-2019, 03:39 AM
  2. copy specific excel charts to a specific powerpoint slides
    By coolin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-26-2019, 08:52 PM
  3. Excel data into text boxes in PowerPoint slides
    By cabroncito29 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2014, 03:48 PM
  4. add a specific slide to a powerpoint array of slides
    By aviben@bezeqint in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2013, 07:27 AM
  5. Copy Excel text to Powerpoint text boxes
    By benihana269 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-15-2013, 12:30 AM
  6. Replies: 2
    Last Post: 02-19-2010, 03:55 PM
  7. Replies: 4
    Last Post: 01-20-2009, 05:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1