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

insert document revision in a cell

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
xfvigour
Guest





PostPosted: Fri Dec 12, 2003 5:58 am    Post subject: insert document revision in a cell Reply with quote

Hi,

As I export my starCalc document in HTML, I'ld like to have a revision number displayed.

How can I make it in suche a way that the field is automatically updated when I
save the document

thank
Back to top
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Fri Dec 12, 2003 7:00 am    Post subject: Reply with quote

it is a great and interesting subject but I am only at the beginning : event listener
Read the Andrew Pitonya's document on Macro (Chapiter 10) for the begining.
After, install XRay (see OOOMacro.org) and lock for documentation of the interface.
DannyB seems to know more on this subject. See his recent posts.
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
avantman42
Super User
Super User


Joined: 28 Jul 2003
Posts: 751
Location: Staffordshire, UK

PostPosted: Fri Dec 12, 2003 7:32 am    Post subject: Reply with quote

An easier alternative might be to display the date and/or time that the document was saved, using the DATE() or TIME() functions.

Russ
Back to top
View user's profile Send private message
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Fri Dec 12, 2003 10:29 am    Post subject: Reply with quote

Here is an exemple of event Listener :
Code:

Dim oGroup As Object
Sub XChartData
    Dim oSCalcDocument,oSheet as Object
     oListener = createUnoListener("OOO_","com.sun.star.chart.XChartDataChangeEventListener")
    oScalcDocument=ThisComponent
    oSheet = oScalcDocument.Sheets(0)
    oGroup=oSheet.getCellRangeByName("A1:A6")
    'XRay.XRay oGroup
    oGroup.addChartDataChangeEventListener(oListener)
End Sub

Sub OOO_chartDataChanged
  msgbox "Coucou"
End Sub

Sub OOO_disposing(oEvent)
   'I don't know if we have or not to write this Sub ??
End Sub

Sub RemoveListener
  oGroup.removeChartDataChangeEventListener(oListener)
End Sub


What does it do ?
It defines a group of cells A1:A6 and when a data is changed in this group print CouCou

When you want to use an event listener you have to find the kind of event listener (here : "com.sun.star.chart.XChartDataChangeEventListener") and how do you install it (here : addChartDataChangeEventListener(oListener))
For this search you need XRay.
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Fri Dec 12, 2003 11:01 am    Post subject: Reply with quote

In my previus code the object OSCalcDocument has a addCloseListener method. It's what do you loock for, i think
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
peter733
Newbie
Newbie


Joined: 03 Jan 2009
Posts: 3

PostPosted: Sat Jan 03, 2009 12:21 am    Post subject: Reply with quote

the pros : copy and paste the code and i can use it right away without changing anything

the cons : why does it pop up the message 16 times ? i haven't alter the code in any way
_________________
http://cli.gs/peter
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 Calc 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