rtf to outlook rtf??

russgreen

Freshman
Joined
Feb 6, 2003
Messages
27
Location
UK
Is there a difference in the rtf file format used by the richtextbox control
and the rtf format used in ms outlook?

I'm using this routing to send an email based on the formatted content of a rich text box but I am getting strange differences shown in the attached screenshot (follow link below).

Does anyone have any ideas why this might be happening.

Russ

Visual Basic:
    Private Sub Mailreport()
        Dim SendMail As System.Diagnostics.Process _
        = System.Diagnostics.Process.Start("mailto:? Subject=Database Report - " & strTitle & " &body=" & Me.rtbReport.Rtf & "")
    End Sub

http://www.russgreen.net/software/images/rtf-formatting.gif
 
The formatting in my programs rich text control is like this...

With rtbReport
.SelectionFont = hdg1Font
.AppendText(strJobType & " Project Details" & vbCrLf)
.SelectionFont = smlFont
.AppendText("report generated on : " & Common.MonthShort & vbCrLf)
.SelectionFont = smlFont
.AppendText("report generated by : " & strUser & vbCrLf)
.AppendText("" & vbCrLf)

.SelectionFont = hdg2Font
.AppendText(strJobNo & "_" & strJobName & vbCrLf)
.SelectionFont = regFont
.AppendText("This job is currently active : " & strJobState & vbCrLf)
.AppendText("" & vbCrLf)

'// etc etc

End With


Russ
 
If you look there is a pattern, its when you dont change fonts it does not terminate, what happens if you load the rtf into word pad?
 
I have a save as on the rif control and I can save the contents of the richtextcontrol and open it in wordpad no problems

Russ
 
Well I just tried this based on what you said then and the same result

.SelectionFont = hdg1Font
.AppendText(strJobType & " Project Details" & vbCrLf)
.SelectionFont = smlFont
.AppendText("report generated on : " & Common.MonthShort & vbCrLf & "report generated by : " & strUser & vbCrLf)
 
Very odd, just another test what if you create two line feeds when the font isnt changed, if i remeber correctly you can make paragraphs too some how in rtf.

Or call append text twice.
 
Well interstingly I just opened the saved rtf file in notepad and this

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil Arial;}{\f1\fnil\fcharset0 Microsoft Sans Serif;}}
{\colortbl ;\red255\green0\blue0;}
\viewkind4\uc1\pard\b\f0\fs28 Residential Project Details\par
\b0\fs16 report generated on : 29MAR03\par
report generated by : Russ Green\par
\f1\fs17\par
\b\f0\fs24 2103_TEST PROJECT\par
\b0\fs20 This job is currently active : True\par
\f1\fs17\par
\b\f0\fs20 Project Status:\par
\b0 NEW PROJECT\par
\cf1 rrrrrrrrrrrrrrrrrrrrrrrr\par
\cf0 Action to be taken by rg\par
\f1\fs17\par
\b\f0\fs20 Description:\par
\b0 bcvbcvbcvfvbfbbgsb\par
\f1\fs17\par
\b\f0\fs20 Contracts:\par
\b0 Form of contract\tab\tab : \par
Form of engagement\tab : \par
\f1\fs17\par
\b\f0\fs20 Location:\par
\b0 12B MORPETH ST\par
\par
\par
HU3 1RF\par
\f1\fs17\par
\par
}
 
Including the SelectionColor = Color.Black everytime and it works but I'm sure I shouldn't have to


.SelectionFont = hdg1Font
.AppendText(strJobType & " Project Details" & vbCrLf)
.SelectionFont = smlFont
.AppendText("report generated on : " & Common.MonthShort & vbCrLf)
.SelectionFont = smlFont
.SelectionColor = Color.Black
.AppendText("report generated by : " & strUser & vbCrLf)
.AppendText("" & vbCrLf)
 
probabbly right, when i remeber using the rtf control it was pretty, well, crap, you had to set SelColor (VB6) every time you wanted to change and stuff, it never really worked the way i expected / wanted it to.
 
Back
Top