Hallo,

With older versions off OO ( now i work under Windows XP , OO 2.3.1 ) i could draw CustomShapes in a WriterDoc using basic code and the API. Using the same code I endup with a invisible shape who only can be focused with the "navigator'
Xraying a manualy placed sha pe ans one by the code show differences
in the "CustomShapeGeometry" where the structure hes more "empty or zero values but i supose it was the same situation in older versions


mi working code was :

sub Insert_Comment
oShape = Thiscomponent.createInstance("com.sun.star.drawing.CustomShape")
oShape.CustomShapeEngine = "com.sun.star.drawing.EnhancedCustomShapeEngine"
propertyValue = createUnoStruct("com.sun.star.beans.PropertyValue")
propertyValue.Name = "Type"
propertyValue.Value = "round-rectangular-callout" properties = Array(propertyValue)
oShape.SetPropertyValue("CustomShapeGeometry", properties)
oText.insertTextContent(oVC, oShape, false)
oShape.Surround = 1
oshape.LayerName = "Heaven" ' "Hell"
oShape.fillcolor = 16776960 oShape.CharFontName = "Arial" oShape.CharFontPitch = 2 oShape.CharHeight = 9
oShape.CharColor = rgb(50,50,50)
oShape.Textwrap = 1
oShape.TextWordWrap = True
oShape.IsFollowingTextFlow = True
oShape.TextHorizontalAdjust = 1
dim  aSize As New com.sun.star.awt.Size
aSize.width = 2000
asize.height = 2000
oshape.setsize(asize)
oShape.AnchorType = com.sun.star.text.TextContentAnchorType.AT_PAGE
oShape.HoriOrient = NONE
oShape.VertOrient = NONE
oShape.VertOrientRelation = PAGE_PRINT_AREA oShape.HoriOrientRelation = PAGE_PRINT_AREA
oShape.name = ucase(environ("USERNAME")) & " " & now

iPagenr = oVC.getpage
'print Ipagenr
oShape.SetPropertyValue("AnchorPageNo", iPagenr)
'xray oViewCursor
 iHCpos = oVC.getPosition().X
iVCpos = oVC.getPosition().Y - ((30700 + 500)* (iPagenr-1)) '500 meer dan de hooghte van de pagina wellicht de spaties tss de pagina's!!!!

oShape.HoriOrientPosition = iHCpos + 1400' + 1400 'left Pagemargin
oShape.VertOrientPosition = iVCpos  - 1100

end SUB


thanks for any  hints

Fernand


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

Reply via email to