OOobbs3/76
質問
他の表計算ドキュメントに、マクロでshapeを追加したいのですが、 一部しか保存されません。フォント、カラー、サイズ等は保存され ません。よろしくお願いいたします。 バージョン:OpenOffice.org2.4.1 Sub AAA Dim doc As Object Dim FileProperties(0) As New com.sun.star.beans.PropertyValue doc = StarDesktop.loadComponentFromUrl(ConvertToUrl("c:\aaa.sxc"), "_blank", 0 , dimArray()) textshape(doc) FileProperties(0).Name = "Overwrite" FileProperties(0).Value = Ture doc.storeAsUrl(ConvertToUrl("c:\aaa.sxc"), FileProperties()) doc.Close(True) End Sub sub textshape(ByRef oDoc As Object) Dim oSheet As Object Dim oDrawPage As Object Dim oShape As Object Dim oText As Object Dim aPos As New com.sun.star.awt.Point Dim aSize As New com.sun.star.awt.Size oSheet = oDoc.Sheets.GetByIndex(0) oDrawPage = oSheet.DrawPage oShape = oDoc.createInstance("com.sun.star.drawing.TextShape") oText = oShape.getText() aPos.x = 200 aPos.y = 200 aSize.Width = 1 aSize.Height = 1 oShape.Position = aPos oShape.Size = aSize oDrawpage.Add(oShape) oText.String = "11.11" oText.CharFontName = "HG PゴシックB Sun" oText.CharHeight = 6.0 oText.CharColor = RGB(255, 0, 255) oShape.TextVerticalAdjust = com.sun.star.drawing.TextVerticalAdjust.TOP oShape.TextHorizontalAdjust = com.sun.star.drawing.TextHorizontalAdjust.LEFT oShape.TextAutoGrowWidth = True oShape.TextAutoGrowHeight = True End Sub 回答
感想,コメント,メモ
|