API: insert note with limited width at a drawing

I want to make a note with limited dimensions. If the line is too long, then the final width of the note should not be greater than the specified value. How can I do that?

SolidworksApi/macros