character properties of heading symbol and heading title
I can control the heading symbol, but the heading title is not well controlled.
In the concrete, the example code below, character posture setting effect on th\
e heading symbol only.
<a href="http://kingyo.tutms.tut.ac.jp/%7Etoshi/StarSuite/Chap7/EX7433.java" target="_blank"> http://kingyo.tutms.tut.ac.jp/%7Etoshi/StarSuite/Chap7/EX743 3.java</a>
<a href="http://kingyo.tutms.tut.ac.jp/%7Etoshi/StarSuite/Chap7/Helper.java" target="_blank"> http://kingyo.tutms.tut.ac.jp/%7Etoshi/StarSuite/Chap7/Helpe r.java</a>
(cf. Paragraph and Outline Numbering, Developer's Guide 2005 June, Chap. 7.4.3)
# 1
I was just using charPosture in Basic the other night. Your results may well depend on what object you apply charPosture to.
My test document consists of 1 paragraph of the Heading 1 paragraph style with numbering set to I,II,III at Tools > Outline numbering.
The actual paragragh looks like this:
I Some text
With the cursor sitting in the word "Some" I get these results when I step through the code below:
1 The While loop changes everything including the number.
2 The middle portion changes only the word "Some".
3 the final portion changes everything including the number.
Interestingly, when I add the two lines that are REMed out nothing seems to occur in the middle section.
I'm using OpenOffice.org2.0.1 which should be equivalent to SO8 with probably the 1st patch applied. You will find much better assistance, especially regarding the API, at www.oooforum.org
<div class="pre"><pre>Sub Main
oDoc = thisComponent
enum = oDoc.Text.createEnumeration
While enum.hasMoreElements
curPara = enum.nextElement
curPara.charPosture = 2 'italics
curPara.charPosture = 0 'normal
Wend
'Middle
oVC = oDoc.getCurrentController.getViewCursor
Rem oTC = oDoc.Text.createTextCursorByRange(oVC) 'Mark oVC position
oVC.charPosture = 2
oVC.charPosture = 0
'Final
oVC.gotoStartOfLine(false)
oVC.gotoEndOfLine(true)
oVC.charPosture = 2
oVC.charPosture = 0
Rem oVC.gotoRange(oTC,false) 'Put view cursor back where it started
End Sub </pre></div>
JohnV at 2007-7-5 2:46:10 >

# 2
Yes, I can set the character property by using the cursor.
But I think, only need is setting "ParaStyleName" which style for example "Heading 1") has property of character posture. But this posture only effect on the heading symbol, omething wrong or my misunderstanding...
> Interestingly, when I add the two lines that are REMed out nothing seems to
> occur in the middle section.
I have not yet using OOo BASIC but you mean oTC.charPosture is nothing effect?
According to the Developer's guide, model cursor capable than view cursor, though.
quote
the view cursor does not have the capabilities as the model cursordoes. Therefore, it is necessary to create a model cursor to have access tothe full text cursor functionality. The method createTextCursor() and createTextCursorByRange() are used
# 3
I think we may be getting beyond my capabilities so I suggest that you ask your question in the API & Macros section at www.oooforum.org.
JohnV at 2007-7-5 2:46:10 >

# 4
Thank you for your direction. I look at www.oooforum.org,
it seems active place, so I will post the question there.
# But my poor English skill, I am embarrassed to post the
# active forum X-)
Thank you again.