Andrew Douglas Pitonyak wrote:
The problem may be related to the anchor point of your bookmark.
Or to the fact that
- the bookmark is a selection bookmark, that holds the entire contents
of the paragraph;
- there is only one parapraph (according the discription given below);
So, some more tests to drive ;-)
Jimmy wrote:
Alright now, this is really getting spooky. I'm now using exactly your
macro and it doesn't do what it's supposed to do. Let me get the steps
straight:
1.) open new writer document
2.) add Text "Test" to document
3.) select the word "Test" and insert a bookmark
4.) select the word "Test" again and insert a section
5.) executing your macro
Here we go with the XML before executing the macro:
<office:body>
<office:text>
<office:forms form:automatic-focus="false"
form:apply-design-mode="false"/>
<text:sequence-decls>
<text:sequence-decl text:display-outline-level="0"
text:name="Illustration"/>
<text:sequence-decl text:display-outline-level="0" text:name="Table"/>
<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
</text:sequence-decls>
<text:section text:style-name="Sect1" text:name="Test">
<text:p text:style-name="Standard">
<text:bookmark-start text:name="Test"/>Test<text:bookmark-end
text:name="Test"/>
</text:p>
</text:section>
</office:text>
</office:body>
The XML after executing:
<office:body>
<office:text>
<office:forms form:automatic-focus="false"
form:apply-design-mode="false"/>
<text:sequence-decls>
<text:sequence-decl text:display-outline-level="0"
text:name="Illustration"/>
<text:sequence-decl text:display-outline-level="0" text:name="Table"/>
<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
</text:sequence-decls>
<text:p text:style-name="Standard">
<text:bookmark-start text:name="Test"/>
<text:bookmark-end text:name="Test"/>
</text:p>
</office:text>
</office:body>
Why aren't you getting the same results?
Oh by the way: Win XP/OO.org 2.0.3
Stephan Wunderlich schrieb:
Hi Jimmy,
Well you're right, there must be something spooky about my
bookmarks, that's why I went looking a little further. You were
right this works just fine, BUT (who would have expected that) I do
have a section around the paragraph at first which I remove either by
currSect.dispose(); or
xText.removeTextContent(currSect);
Both work fine, afterwards I'm left with the same xml as if there
has never been any section. So I'm executing the code you proposed
........AND it doesn't remove the silly bookmark.
So can you beat that? :)
I'll try my best ;-)
Ok now I put my last paragraph into a TextSection and execute
xSection = ThisComponent.TextSections(0)
xText = ThisComponent.getText()
xPCursor = ThisComponent.Text.CreateTextCursor
xText.removeTextContent(xSection)
while xPCursor.gotoNextParagraph(false)
wend
msgbox "last Paragraph"
xPCursor.gotoEndOfParagraph(false)
xPCursor.gotoStartOfParagraph(true)
xPCursor.setString("")
Afterwards the section and the bookmark are gone.
Are you sure that there isn't an empty paragraph behind your section ?
Regards
Stephan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Cor Nouws
Done a test ride and want to investigate the car?
http://marketing.openoffice.org/ooocon2006/schedule.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]