Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
568 views
in Technique[技术] by (71.8m points)

lotus notes - LotusScript: getItemValue("Body") splits paragraphs into several lines

getItemValue("Body") does not retrieve the paragraph of the email correctly, it splits it into several lines.

the body of my email is the following:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut nec consectetur odio. Donec vulputate ultrices facilisis. Curabitur finibus, eros ut malesuada efficitur, lacus felis suscipit neque, at ultricies odio felis imperdiet metus. Sed non tellus ut metus elementum efficitur auctor ut urna. Aliquam placerat justo eu elementum elementum. Integer sodales iaculis ligula et sollicitudin. Vivamus vel quam ornare, tristique lorem at, interdum erat. Nam pharetra dui vel orci semper posuere. Suspendisse bibendum, eros non maximus tristique, dui dolor imperdiet erat, ut feugiat dolor urna eu urna. Maecenas sed quam dolor. Phasellus ultricies, mi eu efficitur mattis, massa massa pretium arcu, non placerat massa nunc eu nisi. Nullam sit amet tempus nisl.

But I get that in the end:

Result of getItemValue("Body")

My code is as follows:

    Dim session As New NotesSession
    Dim ws As New NotesUIWorkspace
    Dim uidoc As NotesUIDocument
    Dim doc As NotesDocument
    Dim varValues As Variant
    Dim valueBody As String
    
    If Not ws.Currentdocument Is Nothing Then
        Set doc = ws.Currentdocument.Document
    Elseif Not session.DocumentContext Is Nothing Then
        Set doc = session.DocumentContext
    End If

    varValues = doc.GetItemValue( "Body" )
    MessageBox varValues(0)

How can I retrieve a paragraph in one piece?

Thank you for your help!

question from:https://stackoverflow.com/questions/65626477/lotusscript-getitemvaluebody-splits-paragraphs-into-several-lines

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can get the field as a NotesRichTextItem field and then use the GetformattedText or GetUnformattedText method to retrieve the content of the rich text field.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...