zipnotic
asked on
Combining RTFs into a single one for richtextbox.rtf
I am trying to combine a series of rtf into a single one for display into a richtextbox.rtf property.
I'm using the following code to trim the first and last characters so they all display at once but the last RTF is being ignored. Everything up until the last rtf is displaying perfectly. After a couple of hours of fiddling I still can't figure out how to properly concatenate and terminate these things.
Here's the code to remove trailing characters of the first RTF and leading character of subsequent RTFs then add in the trailing characters at the end. I think I tried various combinations thereof but I'm hoping someone with more RTF knowledge can point me in the right direction?
Thanks
For i = 0 To dsRM.Tables("Narratives"). Rows.Count - 1
If i = 0 Then
NarrativeText += dsRM.Tables("Narratives"). Rows(i)("N arrativeRT F")
NarrativeText = NarrativeText.Substring(0, NarrativeText.Length - 3)
trailingthree = NarrativeText.Substring(Na rrativeTex t.Length - 3)
End If
If i > 0 Then
tempNar = dsRM.Tables("Narratives"). Rows(i)("N arrativeRT F")
NarrativeText += tempNar.Substring(1, tempNar.Length - 1)
End If
Next
NarrativeText += trailingthree
MsgBox("added last r} back in")
richtextbox1.rtf = NarrativeText
I'm using the following code to trim the first and last characters so they all display at once but the last RTF is being ignored. Everything up until the last rtf is displaying perfectly. After a couple of hours of fiddling I still can't figure out how to properly concatenate and terminate these things.
Here's the code to remove trailing characters of the first RTF and leading character of subsequent RTFs then add in the trailing characters at the end. I think I tried various combinations thereof but I'm hoping someone with more RTF knowledge can point me in the right direction?
Thanks
For i = 0 To dsRM.Tables("Narratives").
If i = 0 Then
NarrativeText += dsRM.Tables("Narratives").
NarrativeText = NarrativeText.Substring(0,
trailingthree = NarrativeText.Substring(Na
End If
If i > 0 Then
tempNar = dsRM.Tables("Narratives").
NarrativeText += tempNar.Substring(1, tempNar.Length - 1)
End If
Next
NarrativeText += trailingthree
MsgBox("added last r} back in")
richtextbox1.rtf = NarrativeText
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.