Solved

Graphics and text in RichTextBox

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 54
Microsoft Access combo box help 2 44
I need help using System.Web.HttpUtility.HtmlEncode in my VB.Net application 3 74
Set email body to html using vbscript 6 41
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 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…

786 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