Solved

RTF Alignment

Posted on 1998-08-20
10
541 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
  • 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 200 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSRS expression Issue finding a string 10 66
How to debug this code 7 56
Added a column screws up code 5 50
Child Form in front 4 38
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now