Solved

RTF Alignment

Posted on 1998-08-20
10
545 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB error "Type mismatch" 2 60
VBA saving file message display 5 72
VBS file using code from 2nd file (txt or vbs) 4 42
Add and format columns in vb6 7 63
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…

856 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