lnOldMemoWidth = set('memowidth') with myEditBox SET MEMOWIDTH TO floor(.Width/(FONTMETRIC(6,.FontName,.FontSize)+1)) lnLines = memlines( .Value ) endwith set memowidth to m.lnOldMemoWidth