Unsuccessful use of CHPX Property!
Posted: Fri Dec 25, 2020 1:27 pm
Hi,
When I run the example that comes with TDOCXReadWriteVCL, I want to insert a formatted string into the doc document, but it fails. The code is as follows:
procedure TfrmMain.Button7Click(Sender: TObject);
var
Para: TAXWLogPara;
CHPX: TAXWCHPX;
begin
// MasterCHP contains the default characher properies.
// The CHPX is a list of exeptions of the CHP.
CHPX := TAXWCHPX.Create(DOCX.Editor.MasterCHP);
try
Para := DOCX.Editor.Paras.AppendPara;
CHPX.Size := 24;
CHPX.Bold := True;
CHPX.TColor := clRed;
CHPX.FillTColor := clBlack;
CHPX.FontName := 'Times New Roman';
Para.AppendPlainText(CHPX,'Lorem ipsum dolor sit amet.');
finally
CHPX.Free;
end;
end;
However,The string ‘Lorem ipsum dolor sit amet.’ is not formatted. Maybe I'm doing something wrong or else it would realy be great if this can be fixed soon.
Thanks for your help.
When I run the example that comes with TDOCXReadWriteVCL, I want to insert a formatted string into the doc document, but it fails. The code is as follows:
procedure TfrmMain.Button7Click(Sender: TObject);
var
Para: TAXWLogPara;
CHPX: TAXWCHPX;
begin
// MasterCHP contains the default characher properies.
// The CHPX is a list of exeptions of the CHP.
CHPX := TAXWCHPX.Create(DOCX.Editor.MasterCHP);
try
Para := DOCX.Editor.Paras.AppendPara;
CHPX.Size := 24;
CHPX.Bold := True;
CHPX.TColor := clRed;
CHPX.FillTColor := clBlack;
CHPX.FontName := 'Times New Roman';
Para.AppendPlainText(CHPX,'Lorem ipsum dolor sit amet.');
finally
CHPX.Free;
end;
end;
However,The string ‘Lorem ipsum dolor sit amet.’ is not formatted. Maybe I'm doing something wrong or else it would realy be great if this can be fixed soon.
Thanks for your help.