Kent,
Border distances (TopBorderDistance) are not working as a property
from the frame but every border (As New com.sun.star.table.BorderLines)
is a different object with a property "linedistance".
Anochter solution is to implement the norderdistances in your paragraph
style (but here topborder (start of the paragraph) will always be 0)
find a more compleet peace of code for placing a frame on a page with
working border distances an keaping track of its finale height
Fernand
Sub FinishGraphicsDialog3
'dim oDoc2 as object
Dim aLBorder As New com.sun.star.table.BorderLine
Dim aRBorder As New com.sun.star.table.BorderLine
Dim aTBorder As New com.sun.star.table.BorderLine
Dim aBBorder As New com.sun.star.table.BorderLine
'oDoc2 = ThisComponent
Dim oFrame As Object , oFrameCursor As Object
Dim iStringhoogte as long
Dim IFramehoogte_alsboven as integer , iFramehoogte_alsonder as integer,
FrameCpos as integer, FrameH as integer
sRasterPagina = oDialog.Model.opPagina.text
lAnchor = com.sun.star.text.TextContentAnchorType.AT_PAGE
oFrame = oDoc.createInstance("com.sun.star.text.TextFrame")
if oDialog.Model.viaCursor.State = 0 then 'and sRasterPagina <> 1 then
iPagenr = sRasterPagina
' iPagenr = oFrame.GetPropertyValue("AnchorPageNo")
endif
if oDialog.Model.viaCursor.State = 1 then
iHCpos = oViewCursor.getPosition().X
iVCpos = oViewCursor.getPosition().Y - (29700 * (iPagenr-1)) '
Vieuwcursor rekend steeds van begin van document
end if
oFrame.width = iFotW
oFrame.SetPropertyValue("AnchorPageNo", iPagenr)
oFrame.AnchorType = lAnchor
oFrame.BackColor = rgb(254,254,100)
oFrame. BackColorTransparency = 0
oFrame.PositionProtected = True
oFrame.SizeProtected = false
oFrame.ContentProtected = false
oFrame.HoriOrient = NONE
oFrame.VertOrient = NONE
oFrame.VertOrientRelation = PAGE_PRINT_AREA
oFrame.HoriOrientRelation = PAGE_PRINT_AREA
aLBorder.OuterLineWidth = 1
alBorder. LineDistance = 300
aRBorder.OuterLineWidth = 1
aRBorder. LineDistance = 300
aTBorder.OuterLineWidth = 1
aTBorder. LineDistance = 300
aTBorder.Color = rgb(0,0,0)
aBBorder.OuterLineWidth = 1
aBBorder. LineDistance = 300
aBBorder.Color = rgb(0,0,0)
oFrame.LeftBorder = aLBorder
oFrame.RightBorder = aRBorder
oFrame.TopBorder = aTBorder
oFrame.BottomBorder = aBBorder
oframe.TopMargin = 172 'wrap aanzetten, anders wordt het automatisch 2mm
oFrame.BottomMargin = 172
oFrame.LeftMargin = 0
oFrame.RightMargin = 0
oText.insertTextContent(oCursor(), oFrame, false)
sOnderschrift = oTextModel.GetPropertyValue("Text")
oFrameCursor = oFrame.createTextCursor()
oFrameCursor.paraStyleName = "5Kl_txt"
oViewCursor.gotoRange(oFrameCursor,false)
FrameCpos = oViewCursor.getPosition().Y
oFrameCursor.String = sOnderschrift
oFrame.SetPropertyValue("HyperLinkName" , "Top")
if oDialog.Model.TekstL.State = 1 then
oFrameCursor.paraStyleName = "5Kl_txt"
' elseif oDialog.Model.TekstR.State = 1 then
' oFrameCursor.paraStyleName = "6_ondR"
elseif oDialog.Model.TekstC.State = 1 then
oFrameCursor.paraStyleName = "5Kc_txt"
endif
oViewCursor.gotoEnd(false)
FrameH = oViewCursor.getPosition().Y - FrameCpos + 345 + 200
if FrameH <= 3450 + AflpB + AflpO then
FrameH = 3450 + AflpB + AflpO
elseif FrameH > 3450 + AflpB + AflpO and FrameH <= 6900 + AflpB +
AflpO then
FrameH = 6900 + AflpB + AflpO
elseif FrameH > 6900 + AflpB + AflpO and FrameH <= 10350 +
AflpB + AflpO then
FrameH = 10350 + AflpB + AflpO
elseif FrameH > 10350 + AflpB + AflpO and FrameH <= 13800 +
AflpB + AflpO then
FrameH = 13800 + AflpB + AflpO
elseif FrameH > 13800 + AflpB + AflpO and FrameH <= 17250 +
AflpB + AflpO then
FrameH = 17250 + AflpB + AflpO
elseif FrameH > 17250 + AflpB + AflpO and FrameH <= 20700 +
AflpB + AflpO then
FrameH = 20700 + AflpB + AflpO
elseif FrameH > 17250 + AflpB + AflpO and FrameH <= 24150 +
AflpB + AflpO then
FrameH = 24150 + AflpB + AflpO
elseif FrameH > 24150 + AflpB + AflpO and FrameH <= 27600 +
AflpB + AflpO then
FrameH = 27600 + AflpB + AflpO
endif
iFramehoogte_alsboven = (FrameH * (-1))
oFrame.VertOrientPosition = iVCpos + iif(oDialog.Model.viaCursor.State
= 1 , 1080 , 1100)
oFrame.Height = FrameH
oFrame.HoriOrientPosition = iHCpos + 900 'left Pagemargin
oFrame.SizeType = 1
oFrame.Name = "P" + iPagenr + "_Kad_" + iHCpos +"_" + iVCpos + "_" +
(tot + 1) ' moet telkens uniek zijn
oViewCursor.gotoRange(oCursor,false)
oDialog.endExecute()
End Sub
Kent Gibson schreef:
Thanks in the end I wrote up something similiar to
your algorithmn.
What I did is I created a shape, then I do
insertTextContent, and then I do getSize and finally
removeTextContent. Then I at least have the size of
the object so I can calculate if there is room enough.
Then instead of a shape I use a TextFrame because I
need the text flow functionality it gives - ie I can
put them in tables.
Unfortunately leftborderdistance and the other
borderdistance properties don't seem to work. Tomorrow
I will enter a bug report for these problems.
Thanks again for your interest.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]