Stephan Lebans RTF Control Append RTF text into another RTF Control (1 Viewer)

Mohsin Malik

Registered User.
Local time
Today, 10:54
Joined
Mar 25, 2012
Messages
175
Hello All,

I am using Stephan Lebans RTF2 ActiveX Control. I have managed some template based text into another table called 'TemplateText', what I would like is to append these template text into another 'RTF Control'. How can I append the template text (RTF text) into another existing RTF Control? Please see the screenshot https://goo.gl/qlVpwW for quick reference.

Thanks
Mohsin
 

sneuberg

AWF VIP
Local time
Yesterday, 23:54
Joined
Oct 17, 2014
Messages
3,506
I don't know anything about the Stephan Lebans RTF2 ActiveX Control but you it seems you're being ignored so I thought I'd see if I could give you something. I've had to deal with rich text before, trying to get it from Access into Word with limited success partly because the HTML that you get out of rich text doesn't contain all of the information that was in the rich text.

Anyway I played with this with Access's rich text controls in the attached database and to my surprize I got something that seems to work. In the attached database you will find a form (RTF Form 1) which has a subform (RTF Subform 2) and a command button (Append Text) whose click event has the following code.

Code:
Private Sub AppendText_Click()

Dim db As DAO.Database
Set db = CurrentDb

db.Execute "UPDATE [RTF Table 1] SET [RTF Table 1].[Rich Text] = '" & SQE(Me.Rich_Text) & SQE(Me.RTF_Subform_2.Form![Rich Text]) & "'"
Me.Refresh

db.Close

End Sub

Private Function SQE(str As String) As String

SQE = Replace(str, "'", "''")

End Function

So this just basically updates the control source of the RTF control with the text in it concatenated with the text in the subform and refreshes the form. If you can adapt this to your situation I suggest testing it thoroughly to make sure formatting isn't lost in this transfer.

Let us know this helps.
 

Attachments

  • RTFMerge.zip
    31 KB · Views: 329

Users who are viewing this thread

Top Bottom