Here is my code, it's not working and I can't find anything wrong with it. If you can, can you please re-post it with corrections or tell me what to correct By the way, its for a medical company in case you havent noticed heh...
Public Class processor
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents RichTextBox1 As System.Windows.Forms.RichTextBox
Friend WithEvents RichTextBox2 As System.Windows.Forms.RichTextBox
Friend WithEvents RichTextBox3 As System.Windows.Forms.RichTextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.RichTextBox1 = New System.Windows.Forms.RichTextBox
Me.RichTextBox2 = New System.Windows.Forms.RichTextBox
Me.RichTextBox3 = New System.Windows.Forms.RichTextBox
Me.SuspendLayout()
'
'RichTextBox1
'
Me.RichTextBox1.BackColor = System.Drawing.Color.Black
Me.RichTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.RichTextBox1.ForeColor = System.Drawing.SystemColors.HighlightText
Me.RichTextBox1.Location = New System.Drawing.Point(0, 0)
Me.RichTextBox1.Name = "RichTextBox1"
Me.RichTextBox1.Size = New System.Drawing.Size(464, 88)
Me.RichTextBox1.TabIndex = 0
Me.RichTextBox1.Text = ""
'
'RichTextBox2
'
Me.RichTextBox2.BackColor = System.Drawing.Color.Black
Me.RichTextBox2.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.RichTextBox2.ForeColor = System.Drawing.SystemColors.HighlightText
Me.RichTextBox2.Location = New System.Drawing.Point(0, 88)
Me.RichTextBox2.Name = "RichTextBox2"
Me.RichTextBox2.Size = New System.Drawing.Size(464, 88)
Me.RichTextBox2.TabIndex = 1
Me.RichTextBox2.Text = ""
'
'RichTextBox3
'
Me.RichTextBox3.BackColor = System.Drawing.Color.Black
Me.RichTextBox3.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.RichTextBox3.ForeColor = System.Drawing.SystemColors.HighlightText
Me.RichTextBox3.Location = New System.Drawing.Point(0, 176)
Me.RichTextBox3.Name = "RichTextBox3"
Me.RichTextBox3.Size = New System.Drawing.Size(464, 208)
Me.RichTextBox3.TabIndex = 2
Me.RichTextBox3.Text = ""
'
'processor
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.Color.Black
Me.ClientSize = New System.Drawing.Size(464, 384)
Me.Controls.Add(Me.RichTextBox3)
Me.Controls.Add(Me.RichTextBox2)
Me.Controls.Add(Me.RichTextBox1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "processor"
Me.Text = "processor"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub processor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
RichTextBox1.Text = Header
'assigning the value selected from the RichTextBox the font style
RichTextBox1.SelectionStart = RichTextBox1.Find("BOWMANVILLE CENTRE FOR SLEEP DISORDERS")
Dim bfont As New Font(RichTextBox1.Font, FontStyle.Bold)
RichTextBox1.SelectionFont = bfont
RichTextBox2.Text = Overall
RichTextBox2.SelectionStart = RichTextBox2.Find("NOCTURNAL POLYSOMNOGRAM RESULT")
Dim ifont As New Font(RichTextBox2.Font, FontStyle.Italic)
RichTextBox2.SelectionFont = ifont
RichTextBox2.SelectionStart = RichTextBox2.Find("TECHNICAL REPORT")
Dim bandifont As New Font(RichTextBox2.Font, FontStyle.Italic & FontStyle.Bold)
RichTextBox2.SelectionFont = bandifont
RichTextBox2.SelectionStart = RichTextBox2.Find("Dr. " & Doctor & "DATE OF STUDY: " & DateOfStudy & "DOB: " & DateOfBirth & "PATIENT: " & Patient & "B.M.I.:" & BMI & " kg/m2" & "TOTAL SLEEP TIME:" & TotalSleepTime & " minutes" & "SLEEP EFFICIENCY:" & SleepEfficiency & "%" & "SLEEP LATENCY:" & SleepLatency & " minutes" & rofl & " LATENCY:" & RemLatency & " minutes" & "NUMBER OF AWAKENINGS:" & NumberOfAwakenings & "AVERAGE DURATION OF AWAKENINGS:" & AverageDurationOfAwakenings & " minutes" & "APNEA & HYPOPNEA INDEX:" & ApneaAndHypopnea & "/hr" & "PLM INDEX:" & PLMIndex & "/hr" & "NUMBER OF AROUSALS ASSOCIATED:---" & "WITH PLMs:" & WithPLMs & "WITH APNEA & HYPOPNEA:" & WithApneaAndHypopnea & "WITH SPONTANEOUS AROUSALS:" & SpontaneousArousals & "REASON FOR REFERRAL:" & ReasonForReferral)
Dim bfont2 As New Font(RichTextBox2.Font, FontStyle.Bold)
RichTextBox2.SelectionFont = bfont2
Everything = RichTextBox1.Text & RichTextBox2.Text
RichTextBox3.Text = Everything
Dim saveFile1 As New SaveFileDialog
saveFile1.DefaultExt = "*.doc"
saveFile1.Filter = "Microsoft Word Documents|*.doc"
If (saveFile1.ShowDialog() = System.Windows.Forms.DialogResult.OK) And (saveFile1.FileName.Length) > 0 Then
RichTextBox3.SaveFile(saveFile1.FileName, RichTextBoxStreamType.PlainText)
End If
Me.Close()
End Sub
End Class

Is There Something Wrong With This?
mschelstrate
My Vizai
My guess is that RichTextBox2.Find is returning a -1 and this is not a valid value for RichTextBox2.SelectionStart
I'd also recommend using StringBuilder for that large string to improve the performance of your program and to make that large concantinated string easier to manage.
Brandon Bloom
DanSem1
Kris M.
What is not working...do you get an error