If you do not have a border in a frame you are not
allowed to set what is referred to in the UI as
Spacing to Contents. I observe that without a border
LeftBorderDistance, RightBorderDistance, etc are
ignored.

Is there no way to get around this? The only success I
have had is with transparent colors, but then you can
sometimes see them in pdf outputs. I just want a frame
with an internal margin and no borders.

I am thinking of submitting a feature request. The
code below creates a frame with a border and a large
spacing to contents. If you leave out the borders it
puts them in. Zero for the line widths doesn't work
either.

regards

###########

Creates a Frame with Borders and 5cm Space to Contents

Sub Main

 oFrame = ThisComponent.createInstance(
"com.sun.star.text.TextFrame" )
 oFrame.Width = 16000
 
 topBorder = createUnoStruct(
"com.sun.star.table.BorderLine" ) 
 bottomBorder = createUnoStruct(
"com.sun.star.table.BorderLine" ) 
 leftBorder = createUnoStruct(
"com.sun.star.table.BorderLine" ) 
 rightBorder = createUnoStruct(
"com.sun.star.table.BorderLine" ) 
                        
 'transparent colors work ie 2139095020
 topBorder.Color = 10
 bottomBorder.Color = 10 
 leftBorder.Color = 10 
 rightBorder.Color = 10 
                                                 
 ' negative numbers or zero will not work
 topBorder.InnerLineWidth = 1
 bottomBorder.InnerLineWidth = 1
 leftBorder.InnerLineWidth = 1
 rightBorder.InnerLineWidth = 1
                
 topBorder.LineDistance  = 0
 bottomBorder.LineDistance  = 0
 leftBorder.LineDistance  = 0
 rightBorder.LineDistance  = 0

 topBorder.OuterLineWidth   = 0
 bottomBorder.OuterLineWidth   = 0
 leftBorder.OuterLineWidth   = 0
 rightBorder.OuterLineWidth   = 0
                                        
 'Null or Empty will not work
 ' 
 oFrame.TopBorder = topBorder
 oFrame.BottomBorder = bottomBorder
 oFrame.LeftBorder = leftBorder
 oFrame.RightBorder = rightBorder

 oFrame.LeftBorderDistance = 5000
 oFrame.RightBorderDistance = 5000
 oFrame.TopBorderDistance = 5000
 oFrame.BottomBorderDistance = 5000

 ThisComponent.Text.insertTextContent(
ThisComponent.Text.Start, oFrame, false )
 oFrame.Text.String = "Hello, this text is within the
frame."

End Sub

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to