Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
Are all the line correctly terminated? Looks like some are not, this the joined lines.

Phil Price�

Visual Studio .NET 2003 Enterprise Edition

Microsoft Student Partner 2004

Microsoft Redmond, EMEA Intern 2004

Posted

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

Posted
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?

Phil Price�

Visual Studio .NET 2003 Enterprise Edition

Microsoft Student Partner 2004

Microsoft Redmond, EMEA Intern 2004

Posted

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.

Phil Price�

Visual Studio .NET 2003 Enterprise Edition

Microsoft Student Partner 2004

Microsoft Redmond, EMEA Intern 2004

Posted

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

}

Posted

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)

Posted
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.

Phil Price�

Visual Studio .NET 2003 Enterprise Edition

Microsoft Student Partner 2004

Microsoft Redmond, EMEA Intern 2004

Posted
Not really looked, only thing i can see different from your code is slightly better member names :)

Phil Price�

Visual Studio .NET 2003 Enterprise Edition

Microsoft Student Partner 2004

Microsoft Redmond, EMEA Intern 2004

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...