DOCXReadWrite Get Text To String
Posted: Sun May 29, 2022 11:58 pm
Hello, how can I read text from file .doc .docx or .txt in Memo1 or String ?
Code: Select all
procedure TfrmMain.Button1Click(Sender: TObject);
var
FDOCX: TDOCXReadWrite;
Str:String;
begin
FDOCX := TDOCXReadWrite.Create(Nil);
if opendialog1.Execute then
FDOCX.LoadFromFile(opendialog1.filename);
memo1.Lines.Add(FDocx.Editor.PlainText); // Not True ???
Str:=FDocx.Editor.PlainText; // Not True ???
FDOCX.Free;
end;