Text Box in pps file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a text box in a pps file where I need the user to enter text into it.
There is also a save and close button which prompts for a save when changes
are made to file. Can someone tell me how to prompt the user to enter their
identification into the text box before they can save and close the file.

Thanks, Aidan.
 
Adding or entering text during a show
http://www.pptfaq.com/FAQ00701.htm

That FAQ entry will give you options to allow for users to enter text
during a show. If you choose a VBA option, you can always add
ActivePresenation.Save to have the presentation automatically save.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
David,
Thanks. I have no experience with VB but I just need the code to force an
entry in a Candidate Identification text box otherwise it won't allow the
file to close.

Thanks. Aidan
 
David,
Thanks. I have no experience with VB but I just need the code to force an
entry in a Candidate Identification text box otherwise it won't allow the
file to close.

When you say "text box" what do you mean? There are several types of text
boxes. How did you create it?

If it's a textbox control vs a normal PPT text box shape, you can rightclick
it, choose View Code, pick the LostFocus event from the dropdown on the right
side of the VB IDE and make it look like this:

Private Sub TextBox1_LostFocus()
If Me.TextBox1.Text = "" Then
Msgbox "Click the text box and enter your name."
End If
End Sub

Add that same bit of code:

If Me.TextBox1.Text = "" Then
Msgbox "Click the text box and enter your name."
End If

to the Click event of your save button before it does anything else (assuming
that it's a vb button again) and that should do it, I think.
 
The code I used is as follows but I want the usual prompt if any changes have
been mafde to the fil, ie Do you want to save the changes... Can anyone help
on this? At the moment the powerpoint slide show is just closing (with
changes saved) without a prompt.

Thanks,

Aidan.


Sub NextSlideifIDcomplete()

Dim CandidateIDmsg As Integer


If Slide3.TextBox1 = "" Then

CandidateIDmsg = MsgBox("Please Enter your Candidate ID", 0, "Test message")

ElseIf Slide3.TextBox1 <> "" Then

ActivePresentation.Save
ActivePresentation.Close


End If


End Sub
 
OK. The ActivePresentation.Save will automatically save it without
asking. Instead of that, you want:

ActivePresentation.Saved = False

That will make PowerPoint think that the file has changed, whether it has
or not, so, on close, it will prompt for the user to save.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
Thanks for swift reply however I need the prompt to save and close the file
to appear once they enter their candidate ID and click on the Save and Close
text box which has the macro attached with code as below. At the moment it is
not doing this. Thanks.

Sub NextSlideifIDcomplete()

Dim CandidateIDmsg As Integer


If Slide3.TextBox1 = "" Then

CandidateIDmsg = MsgBox("Please Enter your Candidate ID", 0, "Test message")

ElseIf Slide3.TextBox1 <> "" Then


ActivePresentation.Saved = False



End If



' Macro recorded 17/10/2006 by brian
'


End Sub
 
From what I udnerstand, you want to close and make sure that it asks
whether you want to save. The ActivePresentation.Saved = False does the
second part. After that, you need to put back the
ActivePresentation.Close to do the first part (the actual closing).
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
David,
I did that but it simply closes the file without a prompt. I need to see the
dialog box appearing that prompts for a save.
 
Aha. Now I see. It seems that all the VBA code that quits a presentation
(Application.Quit, ActivePresentation.Close,
ActivePresentation.SlideShowWindow.View.Exit) ignores the
ActivePresenation.Saved value and never asks if you want to save. Sorry,
I'm out of ideas. Perhaps someone else can solve this one.
--David

David,
I did that but it simply closes the file without a prompt. I need to
see the dialog box appearing that prompts for a save.



--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
David,
I did that but it simply closes the file without a prompt. I need to see the
dialog box appearing that prompts for a save.

Create your own dialog box and display that instead?
 
Thanks to everybody. Steve I don't use VB. The code I got was from a friend.
I'd appreciate the code that prompts for a save. Thanks, Aidan.
 
Thanks to everybody. Steve I don't use VB. The code I got was from a friend.
I'd appreciate the code that prompts for a save. Thanks, Aidan.

Something like this might be all you need:

If MsgBox ("Do you want to save your work?", vbYesNo) = vbYes Then
' do whatever you want to do if they elect to save
MsgBox "Cool. Saving your file now."
Else
' do whatever you want to do if they DON'T want to save
MsgBox "Cool. Trashing your work now."
End If
 
Thanks to you both. It is working like a dream now. Aidan

Neet ... glad to hear it, Aidan. Thanks for letting us know.

Take a bow, Dr. Marco. Mostly your doing ...
 
Back
Top