| View previous topic :: View next topic |
| Author |
Message |
julien_lharidon Newbie

Joined: 09 Jan 2008 Posts: 2
|
Posted: Wed Jan 09, 2008 4:51 am Post subject: [Basic] [Calc] CharHeight inside an Cell Annotation |
|
|
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 |
|
 |
julien_lharidon Newbie

Joined: 09 Jan 2008 Posts: 2
|
Posted: Fri Jan 11, 2008 4:59 am Post subject: |
|
|
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 |
|
 |
skyzone Newbie

Joined: 07 Nov 2008 Posts: 1
|
Posted: Fri Nov 07, 2008 2:26 am Post subject: |
|
|
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 |
|
 |
satabau General User

Joined: 12 Mar 2012 Posts: 34
|
Posted: Thu Mar 29, 2012 8:25 am Post subject: |
|
|
| 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 |
|
 |
|