CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2008
    Posts
    38

    Send richtext as body using lotus notes with Vb 6.0

    Hi,

    I need to send the Richtext formatted text using lotus notes through VB 6.0.

    When i use richtext.textRTF property its appending the text like below

    {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Arial;}}
    \viewkind4\uc1\pard\lang1033\b\fs20
    \par Testing\b0 :Testing
    \par \b Mail:\b0 Testing

    Please help me to send the richtext as formatted one

  2. #2
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Send richtext as body using lotus notes with Vb 6.0

    This IS the formatted Richtext. Rich Text Format is a language which describes formatted text.
    If you save this code to a file "Text.rtf" you'd be able to load it with MSWord getting back your formatted text.
    Also you can load this text back into another RichTextBox for formatted display.

  3. #3
    Join Date
    Apr 2008
    Posts
    38

    Re: Send richtext as body using lotus notes with Vb 6.0

    Thanks for the reply.

    Can you please suggest me how can i incorperate the RTF format from richtext box without losing the formatting in the Mail body using Lotus notes?

  4. #4
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Send richtext as body using lotus notes with Vb 6.0

    If you send the textRTF in any mail you won't loose any formatting information because, as I explained already, the formatting information is embedded as readable commands in pure text format. If the receiver puts the text block back into a RichTextBox, everything is back again. Also the block can be saved to a file 'Text.rtf' and read by MSWord or other rtf-capable editors.

  5. #5
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Send richtext as body using lotus notes with Vb 6.0

    Another thought:
    Save the contents of the RichTextBox to an .rtf file and append this as an attachment to your mail.
    The received file can be saved and reloaded into another RichTextBox easily.
    The RichTextBox features the methods .LoadFile and .SaveFile for these purpose.

  6. #6
    Join Date
    Apr 2008
    Posts
    38

    Re: Send richtext as body using lotus notes with Vb 6.0

    Hi. Thanks for the reply.

    Is there anyoption in lotus notes where i can convert the RTF format to a formatted text.

    Currently i am using the following code.


    Set MailDoc = Maildb.CreateDocument
    With MailDoc
    .Form = "Memo"
    .SendTo = "Test@123.COM"
    .EnterCopyTo = strCC
    .EnterBlindCopyTo = strBCC
    .Subject = "Hello"
    .SaveMessageOnSend = True

    Dim ric As Object
    Set ric = .CreateRichTextItem("Body")
    ric.AppendText rt_box.TextRTF & Chr$(13)
    .Save False, False
    End With


    MailDoc.Send (False)

    Please advise.

  7. #7
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Send richtext as body using lotus notes with Vb 6.0

    I don't know Lotus Notes much...
    but couldn't you have just
    Code:
    With MailDoc
    .Form = "Memo"
    .SendTo = "Test@123.COM"
    .EnterCopyTo = strCC
    .EnterBlindCopyTo = strBCC
    .Subject = "Hello"
    .SaveMessageOnSend = True
    .Body = rt_box.TextRTF & vbCrLf '<--- should append rtf text as ascii.
    at the receiver's side you only have to load Body back to a RichTextBox.TextRTF

  8. #8
    Join Date
    Apr 2008
    Posts
    38

    Re: Send richtext as body using lotus notes with Vb 6.0

    Thanks for the reply.

    I dont have any access at the receiver side. As we are receving/reading mail using lotus notes application.

  9. #9
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Send richtext as body using lotus notes with Vb 6.0

    In this case the best and most flexible way is this:
    Save the contents of the rtb by using its .SaveFile method, thus producing a file.rtf.
    Add this file as attachment to your email. I don't know your mail structure, but there should be some .Attachment property or something.

    The receiver can save the file and open it with MSWord or I think WordPad, too. Or any other editor which can read RichTextFormat.

  10. #10
    Join Date
    Apr 2008
    Posts
    38

    Re: Send richtext as body using lotus notes with Vb 6.0

    Thanks for the comments.

    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured