lundi 23 novembre 2020

VBA Excel PowerPoint Automation: Table of Contents from Checkboxes in UserForm [EASY to solve?]

Im currently working on automatically creating a PowerPoint-Presentation from an Excel Workbook and its working very well. To choose which parts should go into the Presentation, I made a nice little UserForm which looks like this:

My UserForm with different Checkboxes

Each checked Checkbox in the UserForm Calls a Sub that fills the PowerPoint with content.

Now, i want to create a table of contents in the PowerPoint that lists every checked box from the UserForm as a bulletpoint if it did get checked. Then I would have an automatically creatzed Table of contents that lists the contents of the Presentation (the boxes that got checked).

My Method for creating the PowerPoint looks something like this (if needed):

Public Shape As Object
Public PPshape As PowerPoint.Shape
Public PPapp As PowerPoint.Application
Public PPpres As PowerPoint.Presentation
Public PPslide As PowerPoint.Slide
Public rng As Range
Public PPdateipfad As String
Public maturitylevel As String
Public PPtextbox As PowerPoint.Shape
Public Inhalt As String

Sub createPowerPoint()
...
End Sub

The Code for the Form is like this:

Sub Button_StartPP()

If Checkbox1.Value = True Then Call createPowerPoint.Part1
If Checkbox2.value = True Then Call createPowerPoint.Part2
...

Now I just need to add Slide that Lists the Checkboxes from the Form / parts of the PP kinda like this:

Table of Contents

-Part 1

-Part 2

...

What would be the best way to do this? I can't really figure it out but it shouldn't be super difficult. Thank you in advance!




Aucun commentaire:

Enregistrer un commentaire