Solved

Graphics and text in RichTextBox

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

615 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