How to find out whether a selection or range contains any bookmark

R

Reinhart Vollmer

Hi,

I have to find out whether there is a bookmark within a certain
selection or range of my word document and - if there is a bookmark in
the selection/range - which name it has.

I could iterate the bookmarks-list and check each and every bookmark.
But that's seems far too much trouble. Is there a simple way to find out
a bookmark within a selection/range?

Thanks for any idea!

Reinhart.
 
R

Reinhart Vollmer

Thank you so much,

but I found a solution myself in the meantime, that is (Delphi-Code for Word 97, 2000, 2002):

i := WordApplication.Selection.BookmarkID;
if i > 0 then
begin
sName := WordApplication.Activedocument.Bookmarks.Item(i).Name;
...
end;

Thanks again,
Reinhart.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top