Office VBA- detect PowerPoint slide change - vba

I'm creating an application where I'd like to be able to show users an ongoing PowerPoint presentation over the web, where the slide changes as the presenter does so in real time. I've looked at the Office VBA documentation and I didn't see any event for this. The closest I've come are these events, but I don't see anyway of doing what I need to using these.
How can I detect slide changes in Microsoft Powerpoint using Visual Basic?

It seems that this is what you are looking for: Application.SlideShowNextSlide Event
This is VBA Powerpoint object model though, but you should be able to find your way around...

Related

PowerPoint VBA to open an embedded PowerPoint deck for edits

I have a PowerPoint deck and in that deck is a slide with 6 other embedded PowerPoint decks. I want to create VBA code to open each embedded deck, make some changes (which I have the code for), then save (still embedded in the first deck) and close them.
Is there a way to do this within PowerPoint VBA or do I need to use Excel to get this done?
Bonus question - is Microsoft making changes to PowerPoint? They have removed the record macro button, there is almost no support for PowerPoint VBA online (that I have seen. It is all Excel VBA). When they got rid of I.E. they shut down support for HTAs and I am wondering if something similar is happening.
Have tried Open.Presentation, but can't get it to work.

VBA for Powerpoint: Change Slide in One Powerpoint by Selecting Button in Another

I am a beginner at VBA.
I am designing a somewhat interactive Powerpoint presentation/s. I want to be able to have three separate Powerpoint presentations open that will link together. I have been trying (without success) to create, in VBA, code which will change the current displayed slide on one Powerpoint file by clicking a button in another. I can hyperlink to the set slide but this causes this slide to pop up on the same screen in which it is clicked, despite it being already open in another screen (I don't want this).
Thanks in advance for any help,
Holly
VBA uses an object model that is a huge hierarchy of attributes and functions that represent the application. You can use this model to view and update attributes to get text, resize, and modify the application. You should look at some tutorials to get you started. When editing your code, you can press F2 to see and explore this object model. You can press F8 to run your code line by line (debug mode) and see what is happening.
To your question, you can access the open presentations in the application.presentations object (https://learn.microsoft.com/en-us/office/vba/api/powerpoint.presentations). You could then use a presentation in that list and use the ActiveWindow.View.goToSlide function (https://learn.microsoft.com/en-us/office/vba/api/powerpoint.view.gotoslide). Here is a free tutorial that I've used in my VBA journey (https://www.tutorialspoint.com/vba/index.htm).
PowerPoint has a Presentations collection that contains all currently open presentations. You can get a reference to any of them via Presentations("name") where "name" is the filename of the presentation, sans extension.
So ... assuming you've got three presentations open, a.pptx, b.pptx, c.pptx you can do something like this:
Sub SlideChange()
With Presentations("c")
.SlideShowWindow.View.GotoSlide (3)
End With
End Sub
If you run the above in any of the presentations, it will change the slide show window displaying presentation c to the third slide.

PowerPoint VBA code not running unless VB editor opened first

I have a PowerPoint presentation which consists of a single slide and some VBA code. The code displays a dialog box (not inside the presentation) which configures the slide.
I need the code to be started when the presentation is started.
I found various suggestions and ended up going with
this one however I am getting inconsistent results!
If I do the following, in sequence, it works:
Open presentation in PowerPoint
Select Developer tab
Select Visual Basic (to open VBA editor)
Close VBA editor
Select Slide Show tab
Select From Beginning
However, if I skip steps 2-4, it does not! I.E.:
1. Open presentation in PowerPoint
2. Select Slide Show tab
3. Select From Beginning
It is almost as though Visual Basic support isn't even loading until the editor is opened.
I also tried adding a slide before my main one with an auto-transition immediately and again, no-go.
This is driving me insane as I need to get this deployed to the rest of my department.
Anyone have any ideas?
It's kind of a known problem.
OnSlideShowPageChange sometimes doesn't fire. To get around it, add any of the Active-X controls from the Developer tab to the first slide. Scoot it off the slide if you don't want it visible.
Somehow the control forces VBA to initialize, so events fire.
After I did this with your presentation, it fired off right away.

How to put a button into Quick Access Toolbar in MS Word 2010 with a macro (VBA)?

I import bsa file as module. And macro run properly. I need to set up these macros buttons in to Quick Access Toolbar (QAT). I do it manually from standart way as well. But i want to make this automatically with macro (VBA). How these macros assigned to the buttons and buttons set up on the QAT by VBA inside macro?
I searched a lot, and the only way I was able to find was using Office Fluent User Interface.
See this article that walks you through doing it. The example is Excel's QAT, but since all Office Products share the same Type Library, you should be able to adapt it for MS Word 2010.

How to implement Custom Ribbon resizing in Excel 2007?

I'm working in a ribbon project for Excel 2007, using Visual Studio 2008 and VSTO, I'm trying to make my ribbon's groups collapse into galleries when I resize the Excel window, this is a functionality that the other tabs in the ribbon have (the tabs that come with Excel).
At first, I thought this wouldn't be that much difficult, I imagine that it would be like a property from the ribbon, but I have researched a lot about it and it seems that it is not that much easier.
I was looking at this article, there is a post from a guy called "Mike McGavin", he is asking for the same thing that I'm, and the guy that answer his question tells him that auto resize is not current functionality on custom groups/controls.
Now, that post is 1.5 years old...so I'm hoping something new has been out there, maybe some of you know something about it.
Thanks.
It's in 2010. Scroll down to Custom Group Auto-Scaling section.
http://blogs.technet.com/office2010/archive/2009/11/03/ui-extensibility-in-office-2010.aspx