time of day

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

Guest

I have 3 Word art sentenes. I want one to come up on powerpoint at a certain
time (or like from 5:00pm to 9:00pm)

say its 5pm - 9pm, I want the one wordart sentence (good evening) to show,
and in 2 morning hours (like 2am to 10am), I want it to say GoodMorning.
(I want this during the presentation)

Thanks for your time!
 
This can probably be done using VBA programming code within PowerPoint.
Keep in mind that this will NOT work using the free PowerPoint Viewer, the
user must have PowerPoint AND have their Security level set to MEDIUM and
"Enable macros" when asked.

Interested? If so, I will try and work something up as a sample.
 
If you want a simple message box to appear when a button is clicked, put
some sort of object on your slide and assign this macro to it:

Sub TimeTester()
If Hour(Time) < 12 Then
MsgBox ("Good morning, the current time is " & Time)
ElseIf Hour(Time) < 18 Then
MsgBox ("Good afternoon, the current time is " & Time)
Else
MsgBox ("Good evening, the current time is " & Time)
End If
End Sub

If you want different text boxes to appear or different messages to show up
in a text box based on the above code, you will need to do much more. For
example you could create three textboxes with the desired text on your
slide. You will need to use VBA to assign a name to each textbox (code
sample provided below). Then what you do is to modify the above code to
make the desired textbox visible based on the IF statement.

You could also create one textbox and assign the desired text within the IF
portion of the code itself. That way you only have one textbox and the text
that is displayed in it is based on the code.

The name assigned to a textbox is done using the following code (provided by
our resident PowerPoint VBA expert, Shyam - http://skp.mvps.org/):

Sub NameShape()
Dim Name$
On Error GoTo AbortNameShape

If ActiveWindow.Selection.ShapeRange.Count = 0 Then
MsgBox "No Shapes Selected"
Exit Sub
End If
Name$ = ActiveWindow.Selection.ShapeRange(1).Name

Name$ = InputBox$("Give this shape a name", "Shape Name", Name$)

If Name$ <> "" Then
ActiveWindow.Selection.ShapeRange(1).Name = Name$
End If
Exit Sub

AbortNameShape:
MsgBox Err.Description

End Sub

A sample line of code to assign text to a textbox named "TimeOfDay" on Slide
1 is:

ActivePresentation.Slides(1).Shapes("TimeOfDay").TextFrame.TextRange.Text =
"Good Morning"

So, instead of using the MsgBox line of code you could replace the first one
with the line above. Keep in mind that you would need to draw a textbox on
your slide, run the Nameshape code above to name it, then assign the code to
some sort of button that you click in Slide Show mode.

I realize that this is quite a mouthful so if you need me to send a sample
file, holler back.
 
Back
Top