Resource icon

PowerPoint macro for controlling OBS


New Member
Delicategenius submitted a new resource:

PowerPoint macro for controlling OBS - How to control obs from PowerPoint

I wrote a quick VBA macro that will send keystrokes to OBS tot ell it to change scenes. This way your OBS scenes can change when you move through PowerPoint slides. Means I never have to touch OBS when I’m presenting PowerPoint. Saves me a tonne of work and is kind of simple and awesome.

This is it in action.

Here’s the macro script

Sub OnSlideShowPageChange()
Dim i...
Read more about this resource...
I've been looking to go the other way (OBS control PPTx page changes) but I think I can adjust work flow to work in the other direction easily enough. I'll just need to update macros as I have way more than 9 scenes (so will need to use 5 digits and an alternate mapping for scenes #10 and higher... or maybe CRTL+# for 0->9 and then CTRL-SHIFT for 10->19 and instead of OBS# using OBSs# to indicate higher ??? ... hmm, have to ponder.). For HoW stream, I'm at around 15+ scenes (under 20)
Thanks for posting


New Member
Thank you for this code...this was the exact, uncomplicated glue, that I needed for PowerPoint and OBS integration. Simple, easy and very effective.


New Member
Argh I can't get this to work for some reason, don't know if anyone can help?

1. I've added the macro and kept the naming the same, saved the presentation as .pptm and enabled macros in the trust centre
2. I have dual monitors so have tried display capture and window capture for PowerPoint Slide Show

I can't work out what piece I'm missing Delicategenius


New Member
@doely and others

Not Working?
Problem is with the SendKeys command in the script - some type of access violation thing with Windows 10 UAC controller.
  1. RegEdit As Admin
  2. Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  3. Edit the value of EnableLUA and set it to ‘0’
  4. Prompted to Restart = Restart.
  5. Try again = Works
What are consequences of disabling UAC? I don't know.. Probably malware related. but solved it for me.


New Member
Update: And you need an ActiveX component on first slide to trigger the Marco. (So put a checkbox or so from developer tab behind something or off screen) - had that in the test above and worked. removed and stopped working, added again and worked.


New Member
Thanks for sharing this script. Here is another tip to try if it is not working. The script wouldn't work in my Windows 10 dual monitor setup, and adding a "Sleep" function fixed the issue.

Script update

Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub OnSlideShowPageChange()
Dim i As Integer
Dim sNotes As String
Dim sKey As String

i = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
s = Left(ActivePresentation.Slides(i).NotesPage.Shapes.Placeholders(2).TextFrame.TextRange.Text, 4)

If Left(s, 3) = "OBS" Then
sKey = "^" & Right(s, 1)
AppActivate ("OBS")
SendKeys (sKey), 1
'pause for the hotkeys
Sleep 100
AppActivate ("PowerPoint")
End If
End Sub