Solved

Graphics and text in RichTextBox

Posted on 1998-03-19
5
210 Views
Last Modified: 2008-02-26
I can put text in a RTB (RichTextBox1.Text = "Some text") or add to it (RichTextBox1.Text = RichTextBox1.Text +Some more text") but as soon as I add a graphic (OLEObject method) the original text goes. Also is there a quicker method of sending text to the RTB - thanks.
0
Comment
Question by:Jon_Webb
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
sgroner earned 50 total points
Comment Utility
Here is the answer for the second part.

You can use these methods for loading, and saving entire files into a RichTextBox.


rtb.LoadFile pathname, filetype
rtb.SaveFile(pathname, filetype)

Hope this help,  do a search in help for LoadFile, and saveFile for all the required elements.
0
 

Author Comment

by:Jon_Webb
Comment Utility
I'll try this, however I think, perhaps, that this will overwrite the existing text. I need to send the entries in text box's with some qualifying pre-formatted text, then add a graphic, then some more of the same text. Basically the user inputs some data (these are numbers) calculations are performed then the results displayed in a RTB - does this explain more - thanks for your help, Jon
0
 

Author Comment

by:Jon_Webb
Comment Utility
I'll try this, however I think, perhaps, that this will overwrite the existing text. I need to send the entries in text box's with some qualifying pre-formatted text, then add a graphic, then some more of the same text. Basically the user inputs some data (these are numbers) calculations are performed then the results displayed in a RTB - does this explain more - thanks for your help, Jon
0
 
LVL 1

Expert Comment

by:sgroner
Comment Utility
What you might be able to do is create {Field Placeholders} in the preformatted RTF File, then use LoadFile, and then do a quick search and replace on the text in the RTF Box.

For instance,

This is a samle sentence {field1}.

Do a search for {field1} and replace it with your text box value.

Just a thought.  I do not think you can use graphics in a Rich Text Box.  You would need to use a Word Container for that.  The RTB does not support at least to my knowledge any type of graphics, except bullets.

Let me know if you need any more help.
0
 

Author Comment

by:Jon_Webb
Comment Utility
thanks very much, I hadn't tried fields - I'll play with that.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now