Page 1 of 1

Code to importing Docx file

Posted: Thu Dec 07, 2023 6:19 pm
by hamden
Hello;
I would like to know if thereĀ“s a sample code or snippet code (or a demo) of importing DOCX file to a TRichView (or TScaleRichView) component.

Best regards;
Hamden Vogel

Re: Code to importing Docx file

Posted: Fri Dec 08, 2023 8:31 am
by Sergey Tkachenko
The simplest application:

For TRichView

Place RichView1: TRichView (or TRichViewEdit) on a form.
Place RVStyle1: TRVStyle on a form.
Assign RichView1.Style := RVStyle1.

Call:

Code: Select all

RichView1.Clear;
RichView1.LoadDocX(FileName);
RichView1.Format;
For ScaleRichView

Place SRichViewEdit1: TSRichViewEdit on a form.
Call:

Code: Select all

SRichViewEdit1.Clear;
SRichViewEdit1.RichViewEdit.LoadDocX(FileName);
SRichViewEdit1.Format;