procedure TForm1.Button2Click(Sender: TObject);
var
FileName : OleVariant;
I : Integer;
Index : Olevariant;
BookMarkName : string;
begin
WordApp.Connect ;
FileName := 'D:/SendFile/temp/ASP.DOC';
WordApp.Documents.Open(FileName,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam);
for I := 1 to WordApp.ActiveDocument.Bookmarks.Get_Count do
begin
Index := I;
BookMarkName := WordApp.ActiveDocument.Bookmarks.Item(Index).Name;
ListBox1.Items.Add(BookMarkName);
end;
WordApp.Disconnect ;
end;