Graphics

 View Only
  • 1.  word wrap using script editor

    Posted 05-18-2012 16:37
    Good afternoon.

    I know word wrap is coming in v4,,

    Can the script editor in v3 be used perform a word wrap on a text object?

    Thanks

    D'Arc


  • 2.  RE: word wrap using script editor

    Posted 05-18-2012 16:40
    Hi D'Arc,

    try this..

    Dim maxWidth As Double

    Dim newText As String

    Dim line As String

    Dim strWord As String

    Dim list As Array

    maxWidth = 400 'maxWidth = Self.AutoSqueezeWidth

    If Self.GetTextWidthS(Text) > maxWidth Then

    list = Split(Text, " ", -1, 1)

    newText = ""

    line = ""

    For Each strWord In list

    If (Self.GetTextWidthS(line & strWord) > maxWidth) Then

    newText = newText & line & vbCrLf

    line = strWord & " "

    Else

    line = line & strWord & " "

    End If

    Next

    newText = newText & line

    Text = newText

    End If

    #XPression


  • 3.  RE: word wrap using script editor

    Posted 05-18-2012 16:55
    Thanks Chris.

    D'Arc

    #XPression