Надо работать через Ole-объекты.
На новую форму кидаешь кнопку и мемо, затем пишешь код:
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComObj, clipbrd, OleServer, Word2000;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
WordApp,SaveChs,L,E:OLEVariant;
begin
WordApp := CreateOleObject('Word.Application'); //создаем ole-объект Word
WordApp.Documents.Open('d:\test.doc'); //открываем документ
WordApp.Visible:=false; //делаем ворд невидимым
E:=wdExtend;
L:=wdStory;
WordApp.Selection.EndKey(L,E); //выделяем текст
Clipboard.asText:=WordApp.Selection.Text; //копируем в буфер обмена
Memo1.text:=Clipboard.asText; //помещаем текст в мемо
WordApp.ActiveDocument.Close; закрываем документ
end;
end.
Дальше - парсинг: используй pos, copy, insert, delete, lenght.