Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 12-10-2015, 05:48 AM   #1
Mohsin Malik
Newly Registered User
 
Join Date: Mar 2012
Posts: 109
Thanks: 14
Thanked 1 Time in 1 Post
Mohsin Malik is on a distinguished road
Send a message via Yahoo to Mohsin Malik
Stephan Lebans RTF Control Append RTF text into another RTF Control

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

Mohsin Malik is offline   Reply With Quote
Old 12-10-2015, 06:34 PM   #2
sneuberg
AWF VIP
 
Join Date: Oct 2014
Location: Tucson, Arizona
Posts: 3,493
Thanks: 359
Thanked 959 Times in 929 Posts
sneuberg will become famous soon enough sneuberg will become famous soon enough
Re: Stephan Lebans RTF Control Append RTF text into another RTF Control

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.
Attached Files
File Type: zip RTFMerge.zip (31.0 KB, 84 views)
__________________
And now nothing will be restrained from them, which they have imagined to do. Genesis 11:6

Steve
sneuberg is offline   Reply With Quote
Reply

Tags
activex , append , lebans , memo , rtf

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stephan Lebans Print To Pdf - Memory Problem, Office 2000 TimTDP Modules & VBA 6 01-14-2011 01:14 PM
Issues with Lebans RTF control PaulA General 3 03-19-2008 06:49 AM
Problem with Stephen Lebans Rich Text Control gruebz General 1 02-13-2008 05:11 AM
Specifying report filter in Stephan Lebans A2000ReportToPDF roypython Reports 2 05-30-2007 08:23 AM
Lebans RichText Control danposey General 0 11-29-2005 12:43 PM




All times are GMT -8. The time now is 11:41 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World