I am using Powerpoint 2000.
I have 6 presentations in a folder (though the number could be 10, or 20, or 40 in the future).
In each of these presentations, I have created a text box called 'Disclaimer'. I have a userform that will pop up when you run a macro, and fill in a standard disclaimer including the user-inputted client name (through the userform). However, in order to make sure each presentation has the disclaimer, the presenter would have to do this in each successive presentation, which means that there's a significant chance someone will forget, or leave the last client's name in the presentation, etc.
So what I want to do is:- When a presentation is opened, it checks to see if there is a client name in that presentation.
- If the client name exists, I want to pop up a 'Yes/No' dialogue asking if the client name is correct
- If the client name is correct, I want to have the macro confirm that all other presentations (.ppt) in the folder have the same client name, and if not, make sure that they are all changed to that client name
- If the client name is incorrect, I want to have the macro pop up the user form to enter the client name, and then populate the 'Disclaimer' text box with the newly generated disclaimer
- If the client name doesn't exist, I want to have the macro pop up the user form to enter the client name, and then populate the 'Disclaimer' text box with the newly generated disclaimer
Through this logic, any time a presentation is opened, a user should only ever have to enter the client name once to have it populate all presentations in that folder with the 'disclaimer' text box.
I am not entirely VBA illiterate, but I am also not smart enough to do things that involve anything beyond saving to a specific folder. Searching for *.ppt files is a bit beyond my ken. If you could provide any help, it would be greatly appreciated.
Here is the code for the userform (which is a textbox and a submit button):
Dim CustName
Dim Disclaimer
Dim NumSlides As Long
Dim x As Long
Private Sub Submit_Click()
Disclaimer = "Disclaimer first half" & CustName & " disclaimer second half"
CustomerName.Hide
MsgBox (Disclaimer)
NumSlides = ActivePresentation.Slides.Count
For x = 1 To NumSlides
ActivePresentation.Slides(x).Shapes("Disclaimer").TextFrame.TextRange.Text = Disclaimer
Next x
End Sub
Private Sub TextBox1_Change()
CustName = TextBox1.Value
End Sub