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

Access document properties

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


Joined: 06 Mar 2007
Posts: 3

PostPosted: Tue Mar 06, 2007 3:09 am    Post subject: Access document properties Reply with quote

Hi folks

I want to access the document properties of .ods files via ooo basic.

Code:

oWorkbook = StarDesktop.loadComponentFromURL( ConvertToUrl( strDir & strFile ), "_blank", 0, Array() )

'The follwoing properties are clear
oWorkbook.DocumentInfo.getPropertyValue("Title")
oWorkbook.DocumentInfo.getPropertyValue("Subject")
oWorkbook.DocumentInfo.getPropertyValue("Keywords")
oWorkbook.DocumentInfo.getPropertyValue("Comments")

'these are not?
oWorkbook.DocumentInfo.getPropertyValue("Creation Date")
oWorkbook.DocumentInfo.getPropertyValue("Modify Date")


I cannot acces the dates, are the names of these properties ok?
Where can i find a list of all known properties?

Thank you for helping me Smile
Back to top
View user's profile Send private message
Mark B
Super User
Super User


Joined: 16 Feb 2007
Posts: 852
Location: Lincolnshire, UK

PostPosted: Tue Mar 06, 2007 3:24 am    Post subject: Reply with quote

Hi

You'll need to use:
Code:

oCreated = oWorkbook.DocumentInfo.CreationDate

You'll then have access to:

  • oCreated.Year
  • oCreated.Month
  • oCreated.Hours
  • oCreated.Minutes

You can then do the same for oWorkbook.DocumentInfo.ModifyDate.

Mark
_________________
Mark B's Articles
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
makz
Newbie
Newbie


Joined: 06 Mar 2007
Posts: 3

PostPosted: Tue Mar 06, 2007 3:38 am    Post subject: Reply with quote

Oh, great!

Thank you Smile
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