Michel Franckart wrote:

On Sunday 30 January 2005 14:09, G. Roderick Singleton wrote:


On Sun, 2005-01-30 at 13:27 +0100, Michel Franckart wrote:


This bug was already present in 1.1.3.

I generate a macro that inserts the date with format '31 dÃcembre 1999' (Insert > 
Fields > Other ...).
When I launch that macro in another document, the date is replaced by a figure 
e.g. '38382.56' !

Not very important.

Many thanks for your attention and, of course, for that beautiful OOo.

A layman.



THe default format for a Calc cell is number not date. Please fix your
macro so that it sets the cell format properly. By not doing so you get
the result you have.



Sorry, the question was not clear.

- I am working in text documents (.sxw) ;
- The macro is a recorded one ;
- It is meant to automatically insert the date of the day (fixed) into a 
document (letter).

Additionally :
- The 'bug' occurs when I launch the macro in a  n_e_w  document, not when I 
relaunch it inside the document where it was created.
Also strangely, the figure (e.g. '38382.56') transforms into the right date 
format if, somewhere else in my document, I perform the same date insert 
manually !

Kind regards.



You should post the code :-)

The problem is PROBABLY is as follows:
The insertion macro probably inserts a field. The field probably contains a number, which represents the date. The number is formatted to be a date using a numeric style. The style that is assigned to format the number is simply an index into an array of numeric styles supported by your document. In a new document, the style that you want may not yet exist. This is just a guess, of course....


My free macro document contains a section titled


Insert a formatted date field into a Writer document


There is a corresponding macro for inserting into a Cell in a Calc document. The trick is that this macro uses a routine called:


FindCreateNumberFormatStyle("DD. MMMM YYYY", oDoc)

This finds the correct formatting style to use. The document contains this routine as well.

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm
Free Info:  http://www.pitonyak.org/oo.php


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



Reply via email to