• Creator
    Topic
  • #3926
    rfaude
    Participant

    Hi,

    i use my own UI. In the UI i use a MemoControl. When i insert the text form the MemoControl into a plain Mailtext the hard returns are displayed correct.
    When i change the line to RTF-Text (NewMsg.BodyText) no more hard returns are displayed.



    ‘ Insert your comments here


    Sub Main(Client, GWEvent)

    Dim objTask
    NL = Chr(13) & Chr(10)
    InsTab = Chr(9)

    Set Dlg = Utilities.NewControlBoxDialog
    Dlg.Autosize = true
    Dlg.ShowWizardImage = FALSE

    Dlg.Caption = “Hessischer Rundfunk”
    Dlg.Title = “Memo”
    Dlg.Description = “Version 0.0.1″ & NL & ” “

    Set MemoControl1 = Dlg.AddMemoControl
    with MemoControl1
    .Caption = “Description”
    .Left = 90
    .ScrollBars = 4
    .CaptionPosition = afvLeft
    .CaptionAlign = ftaRightJustify
    .Spacing = afvManual
    .SpaceAbove = 40
    .WantTabs = TRUE
    .WantReturns = TRUE
    end with

    rButton = Dlg.Execute

    If rButton = 1 Then

    GroupWise.NewMail

    Set NewMsg = GroupWise.ComposingItem
    if NewMsg is Nothing then
    MsgBox(“No composing item available”)
    else
    NewMsg.Subject = “My Memo”

    ‘ RTF Format
    ‘NewMsg.BodyText = “{rtf1ansiansicpg1252uc1 {bb” & MemoControl1.Text & “b}”

    ‘ Standard Text Format
    NewMsg.BodyText = MemoControl1.Text

    call GroupWise.FocusSet(fcsTo,””)
    Set NewMsg = nothing
    end if

    End If

    Set NewMsg = Nothing
    Set Dlg = nothing

    End Sub

    Any idea? Thanks …

    Best Regards

    Ralf

  • Author
    Replies
  • #6623
    Support 1a
    Participant

    Hello Ralf,

    MemoControl1.Text contains plain ASCII text. Hard returns are represented by standard CR/LF codes (i.e Char(13) & Chr(10)). Inserting plain text into RTF formatted text will not automatically convert the plain text hard returns in to RTF paragraphs.

    I suspect you will need to write a plain text -> RTF conversion function that at the very least converts Chr(13) & Chr(10) codes into RTF par’s. Your code would look something like:

    NewMsg.BodyText = "{rtf1ansiansicpg1252uc1 {bb" & PlainToRTF(MemoControl1.Text) & "b}"

    I hope this helps.

    Advansys Support

    #6625
    rfaude
    Participant

    Thanks for the information. Here is the function which do the work.

    Function PlainToRTF(cBodyText)

    dim iList
    dim Msg

    set iList = Utilities.StringList

    iList.Text = cBodyText

    for iCount = 0 to iList.Count – 1
    if (iCount = 0) Then
    Msg = “{” & iList.Strings(iCount) & “}”
    else
    Msg = Msg & “{par ” & iList.Strings(iCount) & “}”
    end if
    next

    PlainToRTF = Msg

    End Function

    Best Regards

    Ralf

    #6624
    Support 1a
    Participant

    Thank you very much Ralf!

    Advansys Support

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.