Log in

View Full Version : Solved: How to create a presentation from a form



pominoz
05-17-2013, 05:31 PM
Hi there,

I am very new to VBA and am looking for some help form one or more of the gurus on this site :hi:

I have a powerpoint presentation that contains all slides relevant to a specific business area (total of 150 slides. Each slide either represents a managed service area or additional information.

I have also created a form in VBA that will allow a user to select the managed service topic and additional info topics (multi-select listboxes). code below.

This is where I get stuck... I would like for the user to select the relevant slide set they want to create, sing the form, and then when they click OK, for the new presentation to be created only including the slides they have selected, and for those slides to be renumbered correctly.

The presentation containing all slides will be stored in one location always, but I do not want users to access this file and copy/paste/cut etc. I just want them to select the slides they need and have a presentation created for them. This will also help to ensure that the slides they request are always the most up to date as I will maintain the master presentation.

Also, how can I set a button, on the ribbon or quick access toolbar to call the form, and place this on every users powerpoint? Or perhaps when the master presentation is opened the form automatically appears and they have to complete it to create anything?

I hope that this makes sense, any help would be gratefully accepted.

Pominoz

Private Sub cmdCancel_Click()
Unload Me
End Sub

Private Sub cmdClear_Click()
' Clear the form
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Or TypeName(ctl) = "ComboBox" Then
ctl.Value = ""
End If
Next ctl
End Sub

Private Sub UserForm_Activate()
Me.lboService.AddItem "Payroll"
Me.lboService.AddItem "Finance"
Me.lboService.AddItem "HR"
Me.lboAddInfo.AddItem "History"
Me.lboAddInfo.AddItem "Team"
End Sub

John Wilson
05-18-2013, 06:15 AM
That's a huge project for a beginner!

You would need to write a ppam AddIn that also contains XML to create the ribbon entries. The button would need to Load and Show the form
Load.frmName
frmName.Show

Load the form
Read which items were checked

Probably open an untitled (ie copy) of the library presentation and delete the unwanted slides. OR alternatively copy the slides needed into a new presentation.

You could maybe use the InsertFromFile method but this best for contigeous ranges of slides.

pominoz
05-19-2013, 04:08 PM
That's a huge project for a beginner!

You would need to write a ppam AddIn that also contains XML to create the ribbon entries. The button would need to Load and Show the form
Load.frmName
frmName.Show

Load the form
Read which items were checked

Probably open an untitled (ie copy) of the library presentation and delete the unwanted slides. OR alternatively copy the slides needed into a new presentation.

You could maybe use the InsertFromFile method but this best for contigeous ranges of slides.

Hi there,

thanks for this.

I have uploaded an example presentation with just a few slides. I can't create the code needed to either select the correct slides (from a form input) and create the new slide set then save under a new name, or alternatively delete the slides not selected and save the remaining under a new name (perhaps user created name).

The Title Slide will always be slide one in every presentation.

Apologies, but I am very new to this.

Any help would be great.

Thanks, pominoz

John Wilson
05-20-2013, 12:36 AM
Here's how to determine which items in a list box are selected

http://support.microsoft.com/kb/201669

Personally I think you are way out of your depth because this will be quite complex. I have attached some more code but I won't be writing the rest for you (well not free!)

pominoz
05-20-2013, 03:20 PM
Thanks for your replies John, much appreciated.

I will try to learn from what you have provided and then add more to it.

I will mark this thread as solved.

Pominoz