Function FindLabel ([Suburb],[Organisati],[Total])
maxChrs = 24
oldTxt = [Suburb]&vbnewline&[Organisati]&vbnewline&[Total]
While Len(oldTxt) > maxChrs
ptr = InStrRev(Left(oldTxt, maxChrs), " ")
If ptr = 0 Then
ptr = InStr(oldTxt, " ")
If ptr = 0 Then ptr = Len(oldTxt) + 1
End If
newTxt = newTxt + Left(oldTxt, ptr - 1) + vbCrLf
oldTxt = Mid(oldTxt, ptr + 1)
Wend
If oldTxt <> "" Then newTxt = newTxt + oldTxt
FindLabel = newTxt
End Function
No comments:
Post a Comment