Форум: "Потрепаться";
Текущий архив: 2002.04.22;
Скачать: [xml.tar.bz2];
ВнизТекст в .doc Найти похожие ветки
← →
Дмитрий (2002-03-13 20:37) [3]Дарю.
const wdFormatDocument = 0;
wdFormatDOSText = 4;
wdFormatDOSTextLineBreaks = 3;
wdFormatEncodedText = 7;
wdFormatHTML = 8;
wdFormatRTF = 6;
wdFormatTemplate = 1;
wdFormatText = 2;
wdFormatTextLineBreaks = 3;
wdFormatUnicodeText = 7;
{ Это из .tlb }
function ConvertDir(const InDir, OutDir: string): boolean;
var Doc: OleVariant;
F: TSearchRec;
begin
try
CoInitialize(nil);
Doc:=CreateOleObject("Word.Application");
if not (DirectoryExists(OutDir)) then
CreateDirectory(PChar(OutDir), nil);
if FindFirst(InDir+"\*.doc", faAnyFile, F) = 0 then
begin
while FindNext(F) = 0 do
begin
Doc.Documents.Open(InDir+"\"+F.Name);
Doc.ActiveDocument.SaveAs(FileName:=OutDir+"\"+ChangeFileExt(F.Name, ".txt"), FileFormat:=3);
Doc.ActiveDocument.Close();
Application.ProcessMessages();
end;
end;
finally
begin
Doc.Quit;
Doc:=unassigned;
end;
CoUninitialize();
end;
end;
Страницы: 1 вся ветка
Форум: "Потрепаться";
Текущий архив: 2002.04.22;
Скачать: [xml.tar.bz2];
Память: 0.43 MB
Время: 0.006 c