Current Date/Time

G

Greg Franke

I want a slide that can display the current date and time and refresh the
date and time every time the slide displays when the presentation is run in
a loop.

I know I can do this in access by assign a textbox value to Date(). It does
not seem straight forward how this can be done in PowerPoint.
 
C

ciw2otv

Hello Greg,
With a few lines of VBA the date and time can be available and updated.
After placing this code in the Visual Basic Editor, a button on a slide
can be linked to it. Right click on the button and choose "Action
Settings", "Run Macro", "DateTimeTxtBox"

Public Sub DateTimeTxtBox()
With ActivePresentation.Slides(1).Shapes(1).TextFrame
.TextRange = Date & ", " & Time
End With
End Sub

The time will update when clicked, but a more complex routine would be
needed to have a continuous change as the clock ticks away. Hope this
helps.
 
C

ciw2otv

By using the "Header Footer" feature, the date and time can be updated
each time the presentation is opened.
"View", "Header and Footer", "Date and time", "Update automatically"
make it a timely entry.
 
G

Greg Franke

Thanks for the suggestion. I experimented with this yesterday, it would work
for me if there was anything that worked like an "OnLoad" event where I can
trigger an update.

The header/footer option only refreshes when the presentation is opened. I
am trying to make a looping slide show that updated this information every
cycle of the show.
 
C

ciw2otv

Some rework here that needs to have you at the wheel making the changes
in the slides veiwing. Is the looping an autonomous thing that operates
on its own once started? If so, we may be able to gear that to another
function. Let us know, this would be a neat feature if it can get off
the ground and flying.

--------Begin Code------------
'Sets up some buttons that represent slide references
Public Sub TimeDateUpDateSldChng()
Dim n As Integer
Dim SldNo As Long
Dim Pres As Presentation
Set Pres = ActivePresentation
With Pres.SlideMaster.Shapes.AddShape(msoShapeRectangle, 500, 0, 200,
50)
.Name = "TimeDateTxtBox"
.TextFrame.TextRange = Time & ", " & Date
End With
For n = 1 To 4
With Pres.SlideMaster.Shapes.AddShape(msoShapeRectangle, n * 60,
540 - 60, 24, 24)
.Name = "Sld" & n
.TextFrame.TextRange = n
End With
With Pres.SlideMaster.Shapes("Sld" &
n).ActionSettings(ppMouseClick)
.Run = "Identify"
End With
Next n
End Sub

'Makes the update when slide changes, only updates using action buttons
Public Sub Identify(oshp As Shape)
SlideShowWindows(1).View.GotoSlide oshp.TextFrame.TextRange
ActivePresentation.SlideMaster.Shapes("TimeDateTxtBox").TextFrame.TextRange
= Time & ", " & Date
End Sub
---------End Code---------
 
G

Greg Franke

Is the looping an autonomous thing that operates
on its own once started?

Yes, I am setting up a flat panel display in our Lobby that will be running
a PowerPoint slide show with various info. Once set up it will just sit
there and loop all day, which is why I am trying to get this "auto" refresh
of current date and time working.

It almost appears that Microsoft has made it intentionaly hard to
incorporate any dynamic data in the powerpoint application.

If anyone knows of a better program to use for this I am open to
suggestions.
 
S

Steve Rindsberg

Yes, I am setting up a flat panel display in our Lobby that will be running
a PowerPoint slide show with various info. Once set up it will just sit
there and loop all day, which is why I am trying to get this "auto" refresh
of current date and time working.

It almost appears that Microsoft has made it intentionaly hard to
incorporate any dynamic data in the powerpoint application.

If anyone knows of a better program to use for this I am open to
suggestions.

Have a look here:

http://www.presentationpoint.com/

Some of our customers use our PPT2HTML addin to create a looping HTML version
of their PPT presentations for use in kiosks, cable tv displays and the like.
They can point the computer running the display at files on a shared drive,
generate new HTML to that drive from another computer and the presentation
picks up the updated slide next time through the loop.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top