| View previous topic :: View next topic |
| Author |
Message |
xinsi General User

Joined: 30 Aug 2006 Posts: 12
|
Posted: Wed Sep 13, 2006 10:51 pm Post subject: Creaing a DateTime text field in Writer Using API |
|
|
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 |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
|
| Back to top |
|
 |
xinsi General User

Joined: 30 Aug 2006 Posts: 12
|
Posted: Fri Sep 15, 2006 11:04 pm Post subject: |
|
|
| 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 |
|
 |
|