diff --git a/ePublishing/Archive.xba b/ePublishing/Archive.xba index c397e67..0ad7809 100644 --- a/ePublishing/Archive.xba +++ b/ePublishing/Archive.xba @@ -1,6 +1,6 @@ -Sub archMark18 +Sub archMark19 End Sub @@ -81,11 +81,23 @@ Function isAnchorEmpty(anchor As Object) As Boolean isAnchorEmpty = false End Function +Sub disposeBookmark(bookmarkName As String) + Dim bookmarks As Object + Dim bookmark As Object + Dim elementName As String + elementName = ThisComponent.Links.ElementNames(6) + bookmarks = ThisComponent.Links.getByName(elementName) + If bookmarks.hasByName(bookmarkName) Then + bookmark = bookmarks.getByName(bookmarkName) + bookmark.dispose() + EndIf +End Sub Sub createAnchor(targetRange as Object,anchorName as String) dim oViewCursor as object dim document as object - dim dispatcher as object + dim dispatcher as Object + disposeBookMark(anchorName) document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") oViewCursor = ThisComponent.CurrentController.getViewCursor()