Hi,
I'm translating word macros to OpenOffice.org, and I
experience some
turbulence...
the "word" macros uses a lot of bookmarks to
keep track of where in the
document we are working .
The problem that I have is that bookmarks are deleted, when
they should
not be deleted, and I need a solution for this.
example:
I search for some text:
SearchDescriptor = ThisComponent.createSearchDescriptor()
SearchDescriptor.SearchString = "%%%START"
Match = ThisCompnent.findFirst(SearchDescriptor)
Match.setString("")
Bookmark =
ThisComponent.createInstance("com.sun.star.text.Bookma
rk")
Bookmark.Name = "START"
Then Later I do:
Cursor.gotoRange(
ThisComponent.bookmarks.getByName("START").getAn
chor(), False)
Cursor.gotoRange(
ThisComponent.bookmarks.getByName("END").getAnch
or(),
True)
Cursor.setString("") ' Here goes my bookmarks!
How can I keep them?
Or if I do
Cursor.gotoRange(
ThisComponent.bookmarks.getByName("START").getAn
chor(), False)
Cursor.insertDocumentFromURL(SomeURL, Array())
REM then the bookmark is moved to the end, and I'm not able
to track
where I started.
There is also other places where bookmarks
disappears.Basically
everywhere where i work with bookmarks and inserts something
next to
them, or delete text which is next to them. Special problem
is if i do
search and replace, and some text next to a bookmark is
replaced.
Could I insert a controllcaracher that would make sure they
don't get
deleted.
I think, that if one would resolve this, it would make it
much easier
for people to convert their macros from word to
OpenOffice.org, and also
for the people who is working on VBA support in
OpenOffice.org.
--
Knut Olav Bøhmer
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|