Graphics

 View Only
  • 1.  Coding a Line Return in a Text Object

    Posted 07-18-2016 16:16
    I am working on an election results page, and I am trying to figure out a way to make the text object use the Return or Enter key to make a new line when it reaches the space between a person's first name and last name.

    IE:

    Chuck
    Lohf

    Using Word Wrap is inconsistent for this purpose.

    Is there a way to do this with code? Basically I want to tell the code to hit Return or Enter when it occurs a " " in a string of text. I've been able to do it with:

    if Str1.Contains("_")then chr(13)

    but that only tells it to Return at the end of the text string.

    Any ideas?

    Chuck



  • 2.  RE: Coding a Line Return in a Text Object

    Posted 07-18-2016 16:20
    Try : Str1.replace(" ", vbcrlf)
    #XPression


  • 3.  RE: Coding a Line Return in a Text Object

    Posted 07-18-2016 19:39
    Thanks for the quick reply. Can you look at my code and see if I am doing anything wrong? I'm still not getting any change from this.

    "‹Dim Str1 as String
    Dim TestText as xpTextObject

    Self.GetObjectByName("TestText", TestText)


    Str1 = TestText

    If Str1.Contains (" ") then Str1.replace(" ", vbcrlf)
    #XPression


  • 4.  RE: Coding a Line Return in a Text Object

    Posted 07-18-2016 19:56
    Just do this :Dim TestText as xpTextObject
    Self.GetObjectByName("TestText", TestText)
    TestText.Text = TestText.Text.replace(" ", vbcrlf)

    #XPression