- Offizieller Beitrag
Q: I need to update all bookmark names in the document. How can I do this?
A: Bookmarks in Version 5 are just TWPTextObj (just as hyperlinks, mail merge fileds etc)
The name is in the obj.Name property.
So what you need is a list of all wpobjBookmark tagged objects, go through and update 'Name'.
Code
var i : Integer; objlist : TWPTextObjList;
objlist := TWPTextObjList.Create;
WPRichText1.GetCodeTags(objlist, wpobjBookmark, '*ALL*', true);
for i:=0 to objlist.Count-1 do
if objlist.Closing[i]<>nil then
begin
objlist[i].Name := objlist[i].Name + '_changed';
objlist.Closing[i].Name := objlist[i].Name;
end;
objlist.Free;
Alles anzeigen