Ask Your Question
0

in macro, frame automatic height not working? (solved)

asked 2017-04-18 13:55:23 +0200

Pansmanser gravatar image

updated 2017-04-20 16:20:43 +0200

I insert a frame, and want its height to remain fixed, but the property .FrameIsAutomaticHeight=false appears to be ignored. Am I doing something wrong? I have tried setting the height with .Height= and with .FrameHeightAbsolute=. Once inserted, MRI indicates that the property is true, and frame properties from the menu indicates that AutoSize is on. Here is my code:

  oFr1 = oDoc.createInstance("com.sun.star.text.TextFrame")
  oB = oFr1.TopBorder
  oB.LineWidth = 0 : oB.OuterLineWidth = 0
  With oFr1
    .Name = "Frame1p" & nPages
    .VertOrientPosition = 12350 : .HoriOrientPosition = 6940
    '.Width = 400 : .Height = 400
    .FrameHeightAbsolute = 400 : .FrameWidthAbsolute = 400
    .FrameIsAutomaticHeight = FALSE
    .VertOrient = 0 : .VertOrientRelation = 7 'to page
    .HoriOrient = 0 : .HoriOrientRelation = 7
    .AnchorPageNo = nPages : .AnchorType = 0 'to paragraph
    .BorderDistance = 0 : .Surround = 2 'parallel
    .TopMargin=0 : .RightMargin=100 : .BottomMargin=0 : .LeftMargin=100
    .TopBorder = oB : .RightBorder = oB : .BottomBorder = oB : .LeftBorder = oB
  End With
  oDoc.Text.insertTextContent(oTCurs, oFr1, False)
edit retag flag offensive close merge delete

Comments

hello Pansmanser, maybe try .SizeProtected = True the width and height are specified in 1/100th mm

librebel gravatar imagelibrebel ( 2017-04-18 15:12:00 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2017-04-19 22:01:17 +0200

Ratslinger gravatar image

.SizeType = 1 You don't need some settings such as height/width absolute.

edit flag offensive delete link more

Comments

Thanks, Ratslinger. You cracked it as usual.

Pansmanser gravatar imagePansmanser ( 2017-04-20 16:20:31 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-04-18 13:55:23 +0200

Seen: 36 times

Last updated: Apr 20