11/02/2011

python calc macro: create textbox (TextShape) on a sheet

oTextShape = oDoc.createInstance("com.sun.star.drawing.TextShape")  

oSheet.DrawPage.add(oTextShape)  

aa = oSheet.DrawPage.getByindex( n )   


## set string...  
aa.String = "babo hehe"   

## set Size...  
tmpSize = aa.getSize()  
tmpSize.Width = 9999  
aa.setSize(tmpSize)    

## set RotateAngle  
aa.RotateAngle = 9000  ## rotate 90 degree    

## paragraph adjust 
aa.ParaAdjust = 1  ## set right align 


댓글 없음: