|
|
发表于 24-6-2010 05:20 PM
|
显示全部楼层
本帖最后由 雪儿与小鱼儿 于 24-6-2010 05:23 PM 编辑
Dim FileNumber As Integer
Dim TempStr As String
Dim TCol As Long, TRow As Long
Dim TWidth As Long, THeight As Long
FileNumber = FreeFile
TCol = 1
'''open your file
Open App.Path & "\PictureText.txt" For Input As FileNumber
Do While Not EOF(FileNumber)
Line Input #FileNumber, TempStr
'''check if new line length bigger, assign the new length value to TCol
If Len(TempStr) > TCol Then
TCol = Len(TempStr)
End If
TRow = TRow + 1
Loop
Close #FileNumber
TWidth = TCol '''picture box width
THeight = TRow '''picture box height
 |
|