Ask Your Question
0

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

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

Pansmanser gravatar image

updated 2020-07-20 17:42:06 +0100

Alex Kemp gravatar image

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 reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-07-20 17:42:18.638097

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 +0100 )edit

1 Answer

Sort by » oldest newest most voted
1

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

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 +0100 )edit

Question Tools

1 follower

Stats

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

Seen: 94 times

Last updated: Apr 20 '17