Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to justify text in a field
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
OS:
Windows Server 2003
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01021253
Message ID:
01079350
Views:
33
Hi Mike!

I know this thread is a little old but I had a question that I was wondering if you knew off hand.

This code works great on one computer I have running XP that has Word installed on it but on another computer running XP that only has Works on it, it runs without error but does not block justify. Does the computer NEED Word installed on it for this to work correctly or can I just move some dlls or something like that?

Any help would be greatly appreciated!

Thanks!
-Kevin

>>>>>>>>>>>>>>>>>>

Justification in a textbox? I can only assume that your text will appear on more than one line. It is possible to acheive full (or left or right) justification using a RTF control on your report and send the appropriate "switches" to arrive at what you need.
The justification switches for the justification are

\qc Centered.

\qj Justified.

\ql Left-aligned (the default).

\qr Right-aligned.

\qd Distributed.

Here is an example.

1. Create a blank report, put a textbox on it and stretch it out as much as you need. And save it as rtfdemo (in this case)
2. Use the following code.

CLEAR ALL
CLOSE DATABASES all
LOCAL lcStr
lcstr = "Note that there is a limit of 32 characters total for the sum of text"+;
"before and text after for simple numbering. Multilevel numbering has a limit"+;
"of 64 characters total for the sum of all levels.NOTE: The file must have a"+;
".RTF extension to work properly."+;
"Note that there is a limit of 32 characters total for the sum of text"+;
"before and text after for simple numbering. Multilevel numbering has a limit"+;
"of 64 characters total for the sum of all levels.NOTE: The file must have a"+;
".RTF extension to work properly."
CREATE cursor ctext (lctext m,gText g)
INSERT INTO ctext (lctext) VALUES (lcStr)
_rtfFile = "c:\"+SYS(3)+".rtf"
SCAN
SET TEXTMERGE TO &_rtfFile NOSHOW
SET TEXTMERGE ON
\\{\rtf1\ansi\qj <>}
SET TEXTMERGE TO
APPEND GENERAL gText FROM &_rtfFile CLASS "RICHTEXT.RICHTEXTCTRL.1"
ENDSCAN
REPORT FORM rtfdemo PREVIEW NOCONSOLE

I wrote a piece on the subject (In French) that explain this, you can find it here:
http://www.atoutfox.org/articles.asp?ACTION=FCONSULTER&ID=0000000131



>Hello
>
>I want to know if it's possible to justify text in a text box object on a report using Visual FoxPro.
>
>Thanks
>Luis Santos
Kevin Scott
kehvn@carolina.rr.com


Hey! It's not my fault. It's some General named Protection!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform