Sub WriteHeader(FileName$) CreationTime$ = InputBox$("Enter the company creation time ((you must determine this):","Company Creation Time") Rem CreationTime$ = "968018734" If (CreationTime$ = "") Then End Open FileName$ For Append As #1 Line1$ = "!TIMERHDR VER REL IMPORTEDBEFORE FROMTIMER COMPANYCREATETIME" Line2$ = "TIMERHDR 6 0 N Y " OutputLine$ = "Test Tab1 Tab2 " Print #1,"" ' In case there is an _IMPORTED line Print #1,Line1$ Print #1, Line2$; CreationTime$ Rem Close #1 End Sub Sub WriteTimeRecord(StartDate, Duration, Person, Client, Project, Subproject, Other, Billable, Description) Print #1,"!TIMEACT DATE JOB EMP ITEM DURATION NOTE BILLINGSTATUS" Dim Hours As Integer Dim TotalMinutes As Integer TotalMinutes = Duration / 60 Hours = Int(TotalMinutes / 60) Minutes = TotalMinutes - (Hours * 60) MinuteString$ = Str$(Minutes) MinuteString$ = Trim(MinuteString$) If (Minutes < 10) Then MinuteString$ = "0" + MinuteString$ HourString$ = Trim(Str$(Hours)) If (Hours < 10) Then HourString$ = "0" + HourString$ If (True = Billable) Then BillingStatus$ = "0" Else BillingStatus$ = "1" End If Job$ = Client If (Project <> "") Then Job$ = Job$ + ":" + Project If (Subproject <> "") Then Job$ = Job$ + ":" + Subproject Tab$ = " " Print #1, "TIMEACT";Tab$;StartDate;Tab$;JOB$;Tab$;Person;Tab$;Other;Tab$;HourString$;":";MinuteString$;Tab$;Description;Tab$;BillingStatus$ End Sub Sub WriteRecords Dim App As Object Set App = CreateObject("TimeLog.Application") CutoffDate$ = InputBox$("Export Time Records which occurred on or after what date?","Date Cutoff") Rem CutoffDate$ = "01/01/00" App.SetSQL("select startdate, duration, person, client, project, subproject, other, billable, description, key from timerecords where StartDate >= #" + CutoffDate$ + "#") NumRecords = App.GetNumRecords() Dim Person As Variant Dim Client As Variant Dim Project As Variant Dim Subproject As Variant Dim Other As Variant Dim Description As Variant Dim StartDate As Variant Dim Duration As Variant Dim Billable As Variant Dim ResultCode As Long Person = "" Project = "" NewRate = 85.00 For i=1 To NumRecords If i=1 Then App.MoveFirst() Else App.MoveNext() End If Wait .01 Person = "1234567890123456789012345678901234567890" Client = "1234567890123456789012345678901234567890" Project = "1234567890123456789012345678901234567890" Subproject = "1234567890123456789012345678901234567890" Other = "1234567890123456789012345678901234567890" Description = "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" Billable = True 'StartDate = "1/1/00" Duration = 0 StartDate = App.GetFieldValue(0, ResultCode) Duration = App.GetFieldValue(1, ResultCode) Billable = App.GetFieldValue(7, ResultCode) Person = App.GetFieldValue(2, ResultCode) ' Field 0 = Start, Field 1=Person, Field 2=Project Client = App.GetFieldValue(3, ResultCode) Project = App.GetFieldValue(4, ResultCode) Subproject = App.GetFieldValue(5, ResultCode) Other = App.GetFieldValue(6, ResultCode) Description = App.GetFieldValue(8, ResultCode) If (ResultCode <> 0) Then MsgBox("Error encountered getting Field Values") End End If WriteTimeRecord StartDate, Duration, Person, Client, Project, Subproject, Other, Billable, Description Next i App.RefreshDisplay() MsgBox("Export Completed!") End Sub Sub Main On Error GoTo Problem FileName$ = GetFilePath$(,"iif",,"Export Time Data To",3) Rem FileName$ = "c:\program files\timelog\test.txt" If (FileName$ = "") Then End WriteHeader(FileName$) WriteRecords Close #1 End Problem: MsgBox("Error") End Sub