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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Notepad

Status
Not open for further replies.

abe6162

Programmer
Sep 7, 2004
24
US
During a process, I am creating a logfile to capture all the errors.
After the process is done, I would like to display the logfile to show the user.

I am able to write to the file and append it when neccessary, I am just not sure on how to open the file to display it to the user.
Do anyone know how to do this?

These are two functions I use..I need to create the display function

Public Function CreateLogFile()
gblLogFileName = "G:/test/Log/" & GetUserName & Format(Now, "_yyyymmdd_nn.ss") & ".txt"
End Function

Sub LogInformation(LogMessage As String)
Dim FileNum As Integer

FileNum = FreeFile ' next file number
Open gblLogFileName For Append As #FileNum ' creates the file if it doesn't exist
Print #FileNum, LogMessage & _
"| Module : " & gblModuleName & _
"| Form : " & gblFormName ' write information at the end of the text file"
Close #FileNum ' close the file
End Sub
 
You may try either the FollowHyperlink method or this:
Set sh = CreateObject("WScript.Shell")
sh.Run gblLogFileName

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
you could try
Code:
Call Shell("notepad.exe c:\path\to\file.txt", vbNormalFocus)

HTH,
fly

[blue]Typos, that don't affect the functionality of code, will not be corrected.[/blue]

Martin Serra Jr.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top