Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a file using date

Status
Not open for further replies.

mannion

IS-IT--Management
Jun 24, 2002
73
0
0
GB
Hi

Im a newbie to this VB, I basically want to create a script that opens two pps files, on being a welcome screen, the second will say mon-fri and depending on the day will depend on which one it opens! I also want it to run it looped.

Is there anyone who can help?? or does anyone know any sites where I can view sources to try and create this??

Thanks

James Mannion
 
How about calling two functions from your page load? The first could open a named file and the second could open a file where the name comes from the current day? e.g

Code:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1

Private Sub OpenFirstPPSFile()
ShellExecute Me.hwnd, vbNullString, "Presentation1.pps", vbNullString, "C:\", SW_SHOWNORMAL
End Sub

Private Sub OpenDayPPSFile()
ShellExecute Me.hwnd, vbNullString, Weekday(Now) & ".pps", vbNullString, "C:\", SW_SHOWNORMAL
End Sub

Private Sub Form_Load()
OpenFirstPPSFile
OpenDayPPSFile
End Sub

For example, today is wednesday so the second sub will try to open "4.pps". Is this the kind of thing you are trying to do?



----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Thaks dude thats great! ca8msm i owe you a pint!

James Mannion
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top