CodePudding user response:
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
Private Sub MonthView1_DateClick (ByVal DateClicked As Date)
Dim sFilePath As String
With MonthView1
SFilePath=Replace (App) Path & amp; "" & amp; The Year & amp; "Year" & amp; . The Month & amp; "Month" & amp; The Day & amp; "Day. TXT", "\ ", "")
The Open sFilePath For Output As # 1
Close # 1
Call ShellExecute (0, "open", "notepad", sFilePath, 0, 1)
End With
End Sub