hi-ya Stephan,
thanks for that. I should of mentioned that I tried
paragraph margins, ooops. Well it gave me the chance
to try them again with your example. The problem with
paragraph settings is the bottom margin. The spacing
to contents is applied regardless of how many
paragraphs are in the frame. So if you have one
paragraph then the bottom margin does not work.
Here is your example with some changes and you can see
what I mean.
thanks again,
kent
###############################
Sub Main
oDoc = thiscomponent
documentFactory = oDoc
writerShape = documentFactory.createInstance(
"com.sun.star.text.TextFrame" )
aBorder =
createUnoStruct("com.sun.star.table.BorderLine" )
writerShape.TopBorder = aBorder
writerShape.BottomBorder = aBorder
writerShape.LeftBorder = aBorder
writerShape.RightBorder = aBorder
writerShape.setPropertyValue( "FrameWidthAbsolute",
4000 )
writerShape.setPropertyValue( "AnchorType",
com.sun.star.text.TextContentAnchorType.AT_PAGE )
writerShape.setPropertyValue( "TextWrap",
com.sun.star.text.WrapTextMode.NONE )
writerShape.setPropertyValue(
"FrameIsAutomaticHeight", true )
writerShape.setPropertyValue( "VertOrient",
com.sun.star.text.VertOrientation.NONE )
writerShape.setPropertyValue( "HoriOrient",
com.sun.star.text.HoriOrientation.NONE )
writerShape.setPropertyValue( "HoriOrientPosition",
500 )
writerShape.setPropertyValue( "VertOrientPosition",
500 )
mxDocText = oDoc.getText()
mxDocText.insertTextContent(
mxDocText.createTextCursor(), writerShape,false )
writerShape.setString( "SOME RANDOM TEXT SOME RANDOM
TEXT SOME RANDOM TEXT SOME RANDOM TEXT SOME RANDOM
TEXT SOME RANDOM TEXT SOME RANDOM TEXT SOME RANDOM
TEXT SOME RANDOM TEXT SOME RANDOM TEXT SOME RANDOM
TEXT SOME RANDOM TEXT" )
xFrameText = writerShape.Text
xFirstParagraph =
xFrameText.createEnumeration.nextElement
xFirstParagraph.ParaLeftMargin=500
xFirstParagraph.ParaRightMargin=500
xFirstParagraph.ParaBottomMargin=500
xFirstParagraph.ParaTopMargin=500
End Sub
--- Stephan Wunderlich <[EMAIL PROTECTED]>
wrote:
> Hi Kent,
>
> > 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.
>
> instead of trying to set the distance to a non
> existing border you could
> try to set the margins of the text inside the frame.
>
> Something like the following seems to do what you
> want
>
> ----------------------
> oFrame =
>
ThisComponent.createInstance("com.sun.star.text.TextFrame"
> )
> oFrame.Width = 16000
>
> aBorder =
> createUnoStruct("com.sun.star.table.BorderLine" )
>
> oFrame.TopBorder = aBorder
> oFrame.BottomBorder = aBorder
> oFrame.LeftBorder = aBorder
> oFrame.RightBorder = aBorder
>
>
>
ThisComponent.Text.insertTextContent(ThisComponent.Text.Start,
> oFrame,
> false )
> oFrame.Text.String = "Hello, this text is within
> the frame."+chr(13)
> xFrameText = oFrame.Text
> xFirstParagraph =
> xFrameText.createEnumeration.nextElement
> xFirstParagraph.ParaLeftMargin=5000
> xFirstParagraph.ParaRightMargin=5000
> xFirstParagraph.ParaBottomMargin=5000
> xFirstParagraph.ParaTopMargin=5000
> ----------------------
>
> Hope that helps
>
> Regards
>
> Stephan
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
__________________________________________________
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]