russgreen Posted March 29, 2003 Posted March 29, 2003 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 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 Quote Learn Visual Studio .Net My Homepage
philprice Posted March 29, 2003 Posted March 29, 2003 Are all the line correctly terminated? Looks like some are not, this the joined lines. Quote Phil Price� Visual Studio .NET 2003 Enterprise Edition Microsoft Student Partner 2004 Microsoft Redmond, EMEA Intern 2004
russgreen Posted March 29, 2003 Author Posted March 29, 2003 I'm not clear about what you mean... Russ Quote Learn Visual Studio .Net My Homepage
russgreen Posted March 29, 2003 Author Posted March 29, 2003 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 Quote Learn Visual Studio .Net My Homepage
philprice Posted March 29, 2003 Posted March 29, 2003 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? Quote Phil Price� Visual Studio .NET 2003 Enterprise Edition Microsoft Student Partner 2004 Microsoft Redmond, EMEA Intern 2004
russgreen Posted March 29, 2003 Author Posted March 29, 2003 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 Quote Learn Visual Studio .Net My Homepage
russgreen Posted March 29, 2003 Author Posted March 29, 2003 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) Quote Learn Visual Studio .Net My Homepage
philprice Posted March 29, 2003 Posted March 29, 2003 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. Quote Phil Price� Visual Studio .NET 2003 Enterprise Edition Microsoft Student Partner 2004 Microsoft Redmond, EMEA Intern 2004
russgreen Posted March 29, 2003 Author Posted March 29, 2003 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 } Quote Learn Visual Studio .Net My Homepage
russgreen Posted March 29, 2003 Author Posted March 29, 2003 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) Quote Learn Visual Studio .Net My Homepage
russgreen Posted March 29, 2003 Author Posted March 29, 2003 This is really odd. It seems I need to do a SelectionColor = Color.Black on every other line Quote Learn Visual Studio .Net My Homepage
philprice Posted March 29, 2003 Posted March 29, 2003 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. Quote Phil Price� Visual Studio .NET 2003 Enterprise Edition Microsoft Student Partner 2004 Microsoft Redmond, EMEA Intern 2004
russgreen Posted March 29, 2003 Author Posted March 29, 2003 so are the rtf controls in v.2003 any better? Quote Learn Visual Studio .Net My Homepage
philprice Posted March 30, 2003 Posted March 30, 2003 Not really looked, only thing i can see different from your code is slightly better member names :) Quote Phil Price� Visual Studio .NET 2003 Enterprise Edition Microsoft Student Partner 2004 Microsoft Redmond, EMEA Intern 2004
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.