Import RTF document

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Import RTF document

Postby bartsyryn » Fri Jun 12, 2026 4:02 pm

Hello,

I'm trying to import a RTF-document that is generated with MS-Word.
But last-error always gives me error 1004, but in the help of Virtual Print Engine, there's no explanation about that code, so I don't know what I'm doing wrong.
This is vpe 7.20 pro-edition.

The code is in Progress OpenEdge, but maybe someone can help me out with this:

USING IDEALSoftware.VpeProfessional.*.

DEFINE VARIABLE chCtrlFrame AS CLASS VpeControl NO-UNDO.

chCtrlFrame = NEW VpeControl().
chctrlframe:OpenDoc().
chctrlframe:unittransformation = 1000 NO-ERROR.
chctrlframe:PageFormat = PageFormat:A4.
Chctrlframe:setoutrect(250, 250, Chctrlframe:pagewidth - 250, Chctrlframe:pageheight - 250).
Chctrlframe:setdefoutrect(250, 250, Chctrlframe:pagewidth - 250, Chctrlframe:pageheight - 250).
MESSAGE chctrlframe:LastError
VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.

chctrlframe:WriteRTFFile(250, 250, chctrlframe:pagewidth - 250, chctrlframe:nfree, "C:\disctemp\TESTRTF.rtf").
MESSAGE chctrlframe:LastError
VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
chCtrlFrame:Preview().

DELETE OBJECT chctrlframe NO-ERROR.
bartsyryn
 
Posts: 8
Joined: Mon May 11, 2009 10:27 am

Re: Import RTF document

Postby IDEAL Software Support » Mon Jun 15, 2026 4:10 pm

Indeed error 1004 is not defined. We have no explanation why you receive this value.

Are you sure it is not code 204, which means error reading file?
IDEAL Software Support
 
Posts: 1643
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 12 guests