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

Creaing a DateTime text field in Writer Using API

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


Joined: 30 Aug 2006
Posts: 12

PostPosted: Wed Sep 13, 2006 10:51 pm    Post subject: Creaing a DateTime text field in Writer Using API Reply with quote

I want to insert a date or time text filed into a write document. I found Date filed and time field are supplied by the same service: "com.sun.star.text.textfield.DateTime".

If I create a text field in this way:

XTextField xDateField = (XTextField) UnoRuntime.queryInterface(
XTextField.class, Text.myXDocFactory.createInstance (
"com.sun.star.text.TextField.DateTime" ) );

and insert it into my text:

Text.myXText.insertTextContent (Text.myXText.getEnd(), xDateField, false );

A time field will be inserted into the document.

So, how can I create date field or time field seprately?
Anyone can help to fix this problem?
Back to top
View user's profile Send private message
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Fri Sep 15, 2006 11:31 am    Post subject: Reply with quote

http://api.openoffice.org/docs/common/ref/com/sun/star/text/textfield/DateTime.html mentions an IsDate property ...
Back to top
View user's profile Send private message
xinsi
General User
General User


Joined: 30 Aug 2006
Posts: 12

PostPosted: Fri Sep 15, 2006 11:04 pm    Post subject: Reply with quote

ms777 wrote:
http://api.openoffice.org/docs/common/ref/com/sun/star/text/textfield/DateTime.html mentions an IsDate property ...


oh, thanks, problem solved
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