Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Graphics and text in RichTextBox

Posted on 1998-03-19
5
Medium Priority
?
223 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
Steve Groner earned 50 total points
ID: 1459428
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
ID: 1459429
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
ID: 1459430
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:Steve Groner
ID: 1459431
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
ID: 1459432
thanks very much, I hadn't tried fields - I'll play with that.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

715 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