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

x
?
Solved

RTF Alignment

Posted on 1998-08-20
10
Medium Priority
?
556 Views
Last Modified: 2008-03-17
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
Comment
Question by:sbmc
[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
  • 5
  • 4
10 Comments
 
LVL 4

Expert Comment

by:mcix
ID: 1430135
What is it your are trying to accomplish?
0
 
LVL 2

Author Comment

by:sbmc
ID: 1430136
Im trying to align both margins of a paragraph as in Word.
0
 
LVL 1

Accepted Solution

by:
blwatkins earned 600 total points
ID: 1430137
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:sbmc
ID: 1430138
Can you elaborate on the OLE solution ie code example.

Thanks
0
 
LVL 1

Expert Comment

by:blwatkins
ID: 1430139
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
 
LVL 2

Author Comment

by:sbmc
ID: 1430140
Brad

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


Thanks


Dave
0
 
LVL 1

Expert Comment

by:blwatkins
ID: 1430141
you want to resize the control at runtime?  and save the data at runtime or at developmnet?

0
 
LVL 2

Author Comment

by:sbmc
ID: 1430142
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
 
LVL 1

Expert Comment

by:blwatkins
ID: 1430143
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
 
LVL 2

Author Comment

by:sbmc
ID: 1430144
OK thanks for your help.


Dave
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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