OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[Basic] [Calc] CharHeight inside an Cell Annotation

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
julien_lharidon
Newbie
Newbie


Joined: 09 Jan 2008
Posts: 2

PostPosted: Wed Jan 09, 2008 4:51 am    Post subject: [Basic] [Calc] CharHeight inside an Cell Annotation Reply with quote

Hi there,

I am developing a Calc macro and I've been stuck for several days on that issue :
When I add an annotation in calc, the default font size is way too big. Using xray an the web I found the .charheight property. Unfortunately, it does not do what is is supposed to. Even worse, the annotation disappears, I just see the arrow supposed to link the annotation to the cell.
I read in a French forum that somebody had the same issue. It was suggested that it was a bug, but I found no confirmation of that.
Has anybody managed to change the font size of an annotation in Calc with Basic?
I 'm trying to see if I can do it with Java but I still have some trouble using my java function in Calc, and if it a bug, it is likely it won't solve anything ...
Has anybody managed to change the font of an annotation at all?

Here is the kind of code I use:
Code:

oSheets = ThisComponent.Sheets()
oSheet = oSheets.GetByIndex(0)
oCell = oSheet.getCellRangeByName("A1")
oCell.GetAnnotation().GetAnnotationShape.String = "My annotation"
oCell.GetAnnotation().GetAnnotationShape.CharHeight = 14


Any comment appreciated,

Regards,

Ju.
Back to top
View user's profile Send private message
julien_lharidon
Newbie
Newbie


Joined: 09 Jan 2008
Posts: 2

PostPosted: Fri Jan 11, 2008 4:59 am    Post subject: Reply with quote

I've found a trick : I take a cell I will never use, I add manually an annotation (cell A). When I want to add an annotation to the cell B, I copy its properties (value, color etc ...), I copy Cell A at the Cell B address, I restore the original properties and I modify the annotation using the following command:
Code:
MyCell.GetAnnotation().String = "My new annotation"

It keeps the cell A annotation font size.

Not ideal I admit but it works for now. I'm still trying to find something cleaner. If somebody has any idea, let me know.

Ju.
Back to top
View user's profile Send private message
skyzone
Newbie
Newbie


Joined: 07 Nov 2008
Posts: 1

PostPosted: Fri Nov 07, 2008 2:26 am    Post subject: Reply with quote

I have exactly the same problem - setting annotation text on a previously un-annotated cell starts out with a *huge* font in the pop-up, and I don't know how to change it.

CharHeight only seems to affect the permanently unhidden annotation - not the mouse-hover.
Back to top
View user's profile Send private message
satabau
General User
General User


Joined: 12 Mar 2012
Posts: 34

PostPosted: Thu Mar 29, 2012 8:25 am    Post subject: Reply with quote

julien_lharidon wrote:
When I want to add an annotation to the cell B, I copy its properties (value, color etc ...), I copy Cell A at the Cell B address, I restore the original properties
Ju.


Hi, could you give the code of this in Java??
I need it so much!
Thank you all
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group