Ask Your Question
0

How can I insert a fixed date in a CALC footer

asked 2015-07-29 21:55:36 +0200

Edward gravatar image

I have various CALC files with footers incorporating a date field to show revision/update/release date. The date field available in the footer automatically updates when a document is opened. Is there a way (other than entering a date as text) to reference the most recent file SAVE date, instead of today's date? As a workaround I export the files to PDF and print the "fixed date" copies, but if I inadvertently open/print the calc file I get the current date rather than the release date (causing colleagues viewing my hard copies to believe data is current when in actuality the data may be weeks old).

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2015-07-30 00:39:11 +0200

Alex Kemp gravatar image

It must be possible using a macro, but not via the menu (I had a quick search for the location in the object tree but was unsuccessful).

edit flag offensive delete link more
0

answered 2015-07-30 14:13:26 +0200

pierre-yves samyn gravatar image

Hi

You can use a macro like:

sub PysUpDateFooter

dim oDoc as object, oStyle as object, oFooter as object

oDoc = thisComponent

if oDoc.haslocation then    
    oStyle = oDoc.StyleFamilies.getByName("PageStyles").getByName("Default")

'   oFooter = oStyle.LeftPageFooterContent'
    oFooter = oStyle.RightPageFooterContent

    oFooter.LeftText.String = FileDateTime(thiscomponent.url)
'   oFooter.CenterText.String = FileDateTime(thiscomponent.url)'
'   oFooter.RightText.String = FileDateTime(thiscomponent.url)'

    oStyle.RightPageFooterContent = oFooter
end if    

end sub

(Un)comment as needed (left/right page, left/center/right area) Example: UpdateFooter.ods

Regards

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-07-29 21:55:36 +0200

Seen: 191 times

Last updated: Jul 30 '15