• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 558
  • Last Modified:

RTF Alignment

There does not appear to be any way to align both margins of a paragraph using RTF control. Has anyone got code to do this.
0
sbmc
Asked:
sbmc
  • 5
  • 4
1 Solution
 
mcixCommented:
What is it your are trying to accomplish?
0
 
sbmcAuthor Commented:
Im trying to align both margins of a paragraph as in Word.
0
 
blwatkinsCommented:
There is no way to make a RTF control do what you want, The correct words is "Full Justification" this will make both sides of the text be alligned.  

The only way to achieve this is to Use the Microsoft Control "OLE" and make its .class be a word document.  Then you can format the text inside of the control with any formating you can do in word (such as : Full Justification).  This box will look just like a text box control.


0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
sbmcAuthor Commented:
Can you elaborate on the OLE solution ie code example.

Thanks
0
 
blwatkinsCommented:
don't need any code to perform this.  Just open vb, drop an ole object on the form, and pick work from the object type.  Put your text in the box, Highlight the text and right click for a menu and select paragraph formating, and change it from left alignment to "Justified",

Let me know if this isn't enough.

Thanks Brad.

0
 
sbmcAuthor Commented:
Brad

I've tried using the OLE object but how do you resize it and save the data you enter.


Thanks


Dave
0
 
blwatkinsCommented:
you want to resize the control at runtime?  and save the data at runtime or at developmnet?

0
 
sbmcAuthor Commented:
The OLE object seems to determine its own size at run time regardless of the size you  initially create it. At runtime the File menu is not present so how do you save the data?

0
 
blwatkinsCommented:
Use the OLE Save to FILE Statement to save it.
and the resize the control in the Form.Load event.

Make sure to do a DoEvents after resizeing the form.

0
 
sbmcAuthor Commented:
OK thanks for your help.


Dave
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now