Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing to a Word document - paragraphs
Message
From
07/12/2011 09:40:54
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 7
Miscellaneous
Thread ID:
01530519
Message ID:
01530526
Views:
43
Borislav,

Unfortunately, been there - tried that. Word still regards it as beginning a new paragraph.

D

>>Hey all
>>
>>I'm working on an application that produces pen and paper test forms and I want to print the test to a Word document.
>>
>>Here's the problem.
>>
>>There are to 'forms' a question can take; Responses only or some type of prompt and then responses. It must be in the form:
>>
>>
>> 1. He is my _____.                                           2. a) money
>>    a) teacher                                                         b) thirst
>>    b) student                                                         c) luck
>>    c) roommate                                                     d) love
>>    d) friend
>>
>>
>>and so forth.
>>
>>I need to keep the Options with the questions (no page break in the middle) and that's the issue. I can set up the page for two columns, no problem.
>>
>>I build the question/option based on data tables and put the result into a memo field in my printfile. My problem is that Word treats every CR or LF as a new paragraph so that whole 'keep it together' goes right out the window. I've set "Keep Paragraphs Together" to true, but because of the above, it does no good.
>>
>>I've beaten my head against this brick wall until it just quit feeling good to me and then I put it to one side. I really don't want to go back to how the original code worked, which was to create a file consisting of one 80 column field and 'fit' the print to that.
>>
>>Any suggestions? Right now I've got a stopgap in place where the users will print out using a report form and then have to pull it into Word and reformat it and that's just....well....ugly. Luckily, I have some time before they need this functionality - so, hep me hep me ObiWanKaThreaders, you're the only ones who can!
>>
>>Dorris
>
>Try to replace CRLF with CHR(11). Not sure if this will work.
>
>#define CRLF CHR(13)+CHR(10)
>lcMemo = STRTRAN(MemoField, CRLF, Chr(11))
>
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform