Solved

Graphics and text in RichTextBox

Posted on 1998-03-19
5
218 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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

739 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