I need to create an rtf file.

|
I need to create an rtf file. in ObjectPAL topic (part of our Corel Paradox / ObjectPAL Coding group).
Quick Search:
I create
I create rtf
file
|
|
|
|
rkayd
|
I need a Rich Text file for a program I'm using (CorelDraw - merge).
I'm not sure if it works to create an rtf file using ObjectPAL but that would be the easiest, otherwise I would like to know how to access a batch file from ObjectPAL to run a program to convert a txt file to rtf.
Here is the code I am using to create a tab delimited text file: (if I would use the batchfile method I suppose I would have to call it just before it opens the CorelDRAW file)
method pushButton(var eventInfo Event)
var strBegin String strEnd String Counter LongInt NumberOfBooks LongInt BeginNum LongInt z LongInt y LongInt Text TextStream liSuccess LongInt stPath,stFileName String endvar
;define some variables BeginNum = BeginningNumber - NumbersPerBook ;BeginningNumber & NumbersPerBook are fields on form NumberOfBooks = (EndingNumber - BeginningNumber + 1) / NumbersPerBook ;endingNumber is field on form strEnd = string(EndingNumber) ;convert endingNumber to string
Text.Open("Merge.txt","nw") ;open text file to write fields to Text.writeLine("Company,Description,Numbers") ;write file header
;write records into text file for Counter from 0 to NumberOfBooks - 1 ;loop for however many book covers are needed (not sure why the -1 needs to be there) BeginNum=BeginNum+NumbersPerBook ;increment beginning number to next beginning number strBegin=string(BeginNum) ;convert beginning number to string strEnd=string(BeginNum+NumbersPerBook-1) ;calculate ending number and convert it to string ;make number of digits in beginning number equal number of digits in ending number if sizeEX(strBegin) < sizeEX(strEnd) then for y from sizeEX(strBegin) to sizeEX(strEnd)-1 ;not sure why the -1 needs to be there strBegin="0"+strBegin endfor endif ;if number of digits in numbers is less than 4 than add 0's to create 4 digits if sizeEX(strEnd) < 4 then z=sizeEX(strEnd) for y from z to 3 strBegin="0"+strBegin strEnd="0"+strEnd endfor endif ;write record to text file with comma delimiters. Company, Description, Prefix and Suffix are fields on form Text.writeLine(Company+","+Description+","+Prefix+strBegin+Suffix+" to "+Prefix+strEnd+Suffix) endfor
Text.Close()
;open applicable CorelDRAW file stPath = "Z:\\Covers" stFileName = Size + Orientation + ".cdr" liSuccess = cmLaunchFile(stPath, stFileName)
switch case liSuccess > 32 : message("Handle to executed process: " + string(liSuccess)) case liSuccess = 0 : msgStop("Error","The operating system is out of memory or resources.") case liSuccess = 2 : msgStop("Error","The specified file was not found.") case liSuccess = 3 : msgStop("Error","The specified path was not found.") case liSuccess = 5 : msgStop("Error","The operating system denied access to the specified file.") case liSuccess = 8 : msgStop("Error","There was not enough memory to complete the operation.") case liSuccess = 11 : msgStop("Error","The .EXE file is invalid (non-Win32 EXE or error in .EXE image).") case liSuccess = 26 : msgStop("Error","A sharing violation occurred.") case liSuccess = 27 : msgStop("Error","The filename association is incomplete or invalid.") case liSuccess = 28 : msgStop("Error","The DDE transaction could not be completed because the request timed out.") case liSuccess = 29 : msgStop("Error","The DDE transaction failed.") case liSuccess = 30 : msgStop("Error","The DDE transaction could not be completed because other DDE transactions were being processed.") case liSuccess = 31 : msgStop("Error","There is no application associated with the given filename extension.") case liSuccess = 32 : msgStop("Error","The specified dynamic-link library was not found.") otherwise : message("Unknown Error: " + string(liSuccess)) endSwitch endMethod
|
|
Posted 16 years ago (Thread Starter)
|
|
| About rkayd |
|
Approved member.
Member subscribes to this thread with a verified email.
Post ID #14278, 5 replies
Thread Started 9/8/2010 1:08:14 PM
View Counter=2398
Last Reply Posted 5/5/2026 12:58:03 PM)
|
|
|
|
Location=-- UNK
|
|
| |
|
|
|
PS_5438
seo
|
|
|
|
Posted 5 months ago
|
|
| About PS_5438 |
|
Membership pending.
Member subscribes to this thread with a verified email.
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #21600 (Level 2)
and Parent is 14278
Reply Posted 4/7/2026 3:21:04 AM
|
|
|
|
Location=-- USA
|
|
| |
|
|
|
PS_5438
seo
|
|
|
|
Posted 5 months ago
|
|
| About PS_5438 |
|
Membership pending.
Member subscribes to this thread with a verified email.
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #21601 (Level 3)
and Parent is 14278
Reply Posted 4/7/2026 3:23:41 AM
|
|
|
|
Location=-- USA
|
|
| |
|
|
|
PS_5438
seo
|
|
|
|
Posted 5 months ago
|
|
| About PS_5438 |
|
Membership pending.
Member subscribes to this thread with a verified email.
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #21602 (Level 4)
and Parent is 14278
Reply Posted 4/7/2026 3:24:55 AM
|
|
|
|
Location=-- USA
|
|
| |
|
|
|
PS_5438
seo
|
|
|
|
Posted 5 months ago
|
|
| About PS_5438 |
|
Membership pending.
Member subscribes to this thread with a verified email.
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #21603 (Level 5)
and Parent is 14278
Reply Posted 4/7/2026 3:26:25 AM
|
|
|
|
Location=-- USA
|
|
| |
Most Recent Post
|
|
|
PS_5337
|
|
|
|
Posted 4 months ago
|
|
| About PS_5337 |
|
Membership pending.
Member subscribes to this thread with a verified email.
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #21796 (Level 6)
and Parent is 14278
Reply Posted 5/5/2026 12:55:36 PM
|
|
|
|
Location=-- USA
|
|
Revive Thread!
Add a comment to revive this old thread and make this archived thread more useful.
| Thread #14278 Counter |
| 2398 |
|
Since 9/8/2010
|
|
|