OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

margins

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
larsenkc
Guest





PostPosted: Mon Dec 22, 2003 4:10 am    Post subject: margins Reply with quote

Some poor soul asked this question back in sept, & got no answer.

http://www.oooforum.org/forum/viewtopic.php?t=2501&highlight=margins

Where do I find the property for margins in a text document? If I have a frame, I can use the paragraph properties to set the margins, but that's for the distance from the text to the rectangle. It appears that a text document has a frame in which you type, but I want to set the distance from the edge of the page to that rectangle, not from the rectangle to the text inside.

DannyB, I know you're going to solve all my problems, I just wish you were up at all hours of the night! LOL :oP
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Mon Dec 22, 2003 12:01 pm    Post subject: Reply with quote

For Drawing documents, I know the answer, and I knew it in September. Unfortunantly, I don't know the answer for Writer. I would have to look it up. Don't have time right this minute, but maybe later.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
larsenkc
Guest





PostPosted: Tue Dec 23, 2003 9:02 am    Post subject: margins Reply with quote

Maybe of you tell me how for drawing documents, I can figure it out for writer documents?
Back to top
Patrick
Power User
Power User


Joined: 28 Jan 2003
Posts: 60
Location: Kentucky, USA

PostPosted: Tue Dec 23, 2003 10:13 am    Post subject: Reply with quote

You go to format/page/page tab and there you will find where you can set the page margins.
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Tue Dec 23, 2003 10:27 am    Post subject: Reply with quote

larsenkc wrote:
Maybe of you tell me how for drawing documents, I can figure it out for writer documents?


Okay. Here is how I change the margins on Drawings. I use these two routines from my (ever growing) library.

Each routine does two things:
1. Change the portrait / landscape setting so that OOo prints it rotated.
2. Changes the "margins" to match the new orientation.

Code:
'----------
'   Pass in any GenericDrawPage object in portrait orientation,
'    and this changes it to Lanscape orientation.
'
Sub SetDrawPageOrientationLandscape( oDrawPage As com.sun.star.drawing.GenericDrawPage )
   ' Save some settings
   nOldWidth = oDrawPage.Width
   nOldHeight = oDrawPage.Height
   nOldBorderTop = oDrawPage.BorderTop
   nOldBorderLeft = oDrawPage.BorderLeft
   nOldBorderRight = oDrawPage.BorderRight
   nOldBorderBottom = oDrawPage.BorderBottom
   
   ' Change so that it will PRINT in landscape
   oDrawPage.Orientation = com.sun.star.view.PaperOrientation.LANDSCAPE
   
   ' Now change some paper dimensions to match
   oDrawPage.Width = nOldHeight
   oDrawPage.Height = nOldWidth
   oDrawPage.BorderTop = nOldBorderRight
   oDrawPage.BorderLeft = nOldBorderTop
   oDrawPage.BorderRight = nOldBorderBottom
   oDrawPage.BorderBottom = nOldBorderLeft
End Sub



'----------
'   Pass in any GenericDrawPage object in portrait orientation,
'    and this changes it to Lanscape orientation.
'
Sub SetDrawPageOrientationPortrait( oDrawPage As com.sun.star.drawing.GenericDrawPage )
   ' Save some settings
   nOldWidth = oDrawPage.Width
   nOldHeight = oDrawPage.Height
   nOldBorderTop = oDrawPage.BorderTop
   nOldBorderLeft = oDrawPage.BorderLeft
   nOldBorderRight = oDrawPage.BorderRight
   nOldBorderBottom = oDrawPage.BorderBottom
   
   ' Change so that it will PRINT in landscape
   oDrawPage.Orientation = com.sun.star.view.PaperOrientation.PORTRAIT
   
   ' Now change some paper dimensions to match
   oDrawPage.Width = nOldHeight
   oDrawPage.Height = nOldWidth
   oDrawPage.BorderTop = nOldBorderLeft
   oDrawPage.BorderLeft = nOldBorderBottom
   oDrawPage.BorderRight = nOldBorderTop
   oDrawPage.BorderBottom = nOldBorderRight
End Sub


Unfortunantly, I don't think this will help you at all in changing the margins for Writer documents. (But I've been wrong before.)
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group