Width # statement
Assigns an output line width to a file opened by using the Open statement.
Syntax
Width #filenumber, width
The Width # statement syntax has these parts:
Part | Description |
---|---|
filenumber | Required. Any valid file number. |
width | Required. Numeric expression in the range 0–255, inclusive, that indicates how many characters appear on a line before a new line is started. If width equals 0, there is no limit to the length of a line. The default value for width is 0. |
Example
This example uses the Width # statement to set the output line width for a file.
Dim I
Open "TESTFILE" For Output As #1 ' Open file for output.
VBA.Width 1, 5 ' Set output line width to 5.
For I = 0 To 9 ' Loop 10 times.
Print #1, Chr(48 + I); ' Prints five characters per line.
Next I
Close #1 ' Close file.
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기