I have these line of code in a program but it does not format the data so that the information is in colums
Open FILE For Append As #1
Print #1, fullname, objectname, fieldvalue,_
timenow, datenow, COMPUTERNAME, macaddress
Close #1
End Function
Printable View
I have these line of code in a program but it does not format the data so that the information is in colums
Open FILE For Append As #1
Print #1, fullname, objectname, fieldvalue,_
timenow, datenow, COMPUTERNAME, macaddress
Close #1
End Function
If you want to overwrite an existing file, use this:
If you want to write to the end of it rather than overwriting it:Code:Open "C:\FILE" For Output As #1
Print #1, fullname, objectname, fieldvalue, _
timenow, datenow, COMPUTERNAME, macaddress
Close #1
For me, it is in columns..looks like this:Code:Open "C:\FILE" For Append As #1
Print #1, fullname, objectname, fieldvalue, _
timenow, datenow, COMPUTERNAME, macaddress
Close #1
If that doesn't work, try using vbTab.Code:fullname objectname fieldvalue timenow datenow COMPUTERNAME macaddress
Code:Print #1, fullname & vbTab & objectname & vbTab & fieldvalue _
& vbTab & timenow & vbTab & datenow & vbTab & COMPUTERNAME & vbTab & macaddress
Thanks for that the last one works