Ром, нету у його свойства characters. там всё немножко веселее:
uses
ActiveX, ComObj;
function GetCharStats (AFileName: string; AWithSpaces, AInFootnotes: boolean): integer;
var
w: TWordApplication;
FileName,
varIncludeFootnotes,
varSaveChanges: OleVariant;
Stats: TOleEnum;
begin
FileName := AFileName;
varIncludeFootnotes := AInFootnotes;
varSaveChanges := FALSE;
if AWithSpaces then
Stats := $00000003
else
Stats := $00000005;
w := TWordApplication.Create(nil);
try
w.Documents.Open(FileName,EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam);
Result := w.ActiveDocument.ComputeStatistics(Stats, varIncludeFootNotes);
w.ActiveDocument.Close(varSaveChanges,EmptyParam,EmptyParam);
finally
w.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
ShowMessage (IntToStr (GetCharStats (OpenDialog1.FileName, TRUE, TRUE)));
end;