Ave,

I recorded what I supposed to be a very straightforward macro:

sub insertHereBookmark

dim document   as object
dim dispatcher as object

document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Bookmark"
args1(0).Value = "here"

dispatcher.executeDispatch(document, ".uno:DeleteBookmark", "", 0, args1())

dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Bookmark"
args2(0).Value = "here"

dispatcher.executeDispatch(document, ".uno:InsertBookmark", "", 0, args2())

end sub

It was supposed to delete the bookmark named "here" and then insert it at current cursor position - just a simple "last worked here" tag for me. Now, the problem is, it behaves a little different: it does not delete the bookmark, and creates a bookmark "hereX", where X are subsequent numbers. The same happens even if the bookmark "here" does not exist - bookmark "here1" is created, next time "here2" and so on.

Could somebody point out what I am doing wrong, please?
(My OOo version is 1.9.122, under WinXP.)
--
Andrzej Sawula

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to