![]() |
|
#1
|
|||
|
|||
|
My problem is that write # appears to embed each record in quotation marks unless I end the command with a semicolon. The issue there is that the record itself contains semicolons.
The print # takes care of that issue but appears to create an empty record at the end of the file. (i.e. an extra vbCrLf) The workaround is straight forward Code:
varRoster = Input(LOF(lngFile), lngFile)
' render records as an array
arrRoster = Split(varRoster, vbCrLf)
' Using Print # command to save file unavoidably
' creates extra vbCrLf at end of file
If Len(arrRoster(UBound(arrRoster))) < 1 Then
ReDim Preserve arrRoster(UBound(arrRoster) - 1)
End If
(Note: the rest of the application uses arrRoster, so I am not splitting the variant to an array simply for this purpose) Last edited by grNadpa; 11-07-2022 at 11:14 AM. Reason: Clarify that the split reason |
|
| Tags |
| output to file, vba, word 2016 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Print options - Staples
|
alive15 | Word | 1 | 12-01-2017 05:14 PM |
| Print output on a long report is too small | jood | Excel | 5 | 10-19-2015 07:27 PM |
Read text Report file with VBA and write parsed fields to Excel workbook
|
tpcervelo | Excel Programming | 1 | 01-05-2012 10:14 PM |
| Having to Confirm SQL Command | mrdavie | Mail Merge | 0 | 02-24-2011 04:38 PM |
Print only images or only text in word file
|
mrj1233 | Drawing and Graphics | 1 | 01-17-2011 10:54 PM |