Have you tried using IAnnotation::Width?
I did notice that, but have not been able to successfully use it and this very well may be due to my VBA inexperience. However, I am unsure if it is useful for a note because the API Help descrition refers to line width: "Gets or sets the line width enumeration value for this annotation"
My existing code is almost directly from recording a Solidworks macro:
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Dim myModelView As Object
Set myModelView = Part.ActiveView
myModelView.FrameState = swWindowState_e.swWindowMaximized
Dim myNote As Object
Dim myAnnotation As Object
Dim myTextFormat As Object
Set myNote = Part.InsertNote( _
"<FONT style=B>NOTES:<FONT style=RB>" + Chr(13) + Chr(10) + Chr(13) + Chr(10) + _
"<PARA indent=5 findent=-5 number=on ntype=1 nformat=$$. nstartNum=1>" + _
"Note-1..." + Chr(13) + Chr(10) + _
"Note-2..." + Chr(13) + Chr(10) + _
myNote.LockPosition = False
myNote.Angle = 0
boolstatus = myNote.SetBalloon(0, 0)
Set myAnnotation = myNote.GetAnnotation()
longstatus = myAnnotation.SetLeader3(swLeaderStyle_e.swNO_LEADER, 0, True, False, False, False)
boolstatus = myAnnotation.SetPosition(1.38441941410529E-02, 0.265465006735639, 0)
boolstatus = myAnnotation.SetTextFormat(0, True, myTextFormat)
' <THIS IS WHERE I AM ATTEMPTING TO SET THE TEXT BOX WIDTH>
I feel closer to the anwer but not quite there
I was referred to ITextFormat::LineLength for setting the width of a bounding box. However, I have not been successful with it. It seems I can use every other item in the set of ITextFormat Interface members except for LineLength.
Dim swTextFormat As SldWorks.TextFormat
MsgBox ( "LineLength:" & swTextFormat.LineLength)
When I test this just to see what is in a preselected note, it returns 0 (zero) most of the time (I did have 0.5 return a few times but I cannot duplicate now). Regardless, It does not seem to change the value based on how large I make the text bounding box.
If I stumble on something that works, I will post it.
Do you find anything? I am also looking to word warp my text.
I never did find a solution to work quite the way I intended. I also have not looked at this in quite a long time; so I am not sure if there are new API methods that have been introduced.
I have a reply from the API team.
This functionality has not been yet supported via the APIs, we already have a dedicated SPR regarding this enhancement.
SPR : 969909 : New APIs required in INote Interface for set/get the Wordwrap option and set/get the value of the Wordwrap width.
I am attaching this SPR to your service request you will be automatically notified when this issue gets fixed.
Dassault Systèmes SolidWorks Corp. API Support
As a workaround for now I am cutting and pasting notes with predefined wordwrap widths as it carries over.
Thanks for the thought Elmar. Unfortunately that changes the character width of the text (it widens the letters). I was instead looking for a way to increase the bounding box dimension of the Note.
I cannot find a way to do this. I've looked in many places. You probably have to somehow get the actual object, not SW note but I think it's a wpf form or something. With that you could possibly access it. But probably not.