| View previous topic :: View next topic |
| Author |
Message |
PromptJock Super User


Joined: 26 Jul 2006 Posts: 741
|
Posted: Thu Aug 03, 2006 11:23 am Post subject: Changing default date format in Writer? |
|
|
Simple question: when I insert a Date field in Writer, it appears in "MM/DD/YY" ("08/03/06") format. I want to CHANGE the default Insert Date Field format to "text date" format (i.e. "August 3, 2006").
I've searched all the Help topics and configuration options in OpenOffice and Writer and can't find the way to do it. Right now, I have to manually change the format after I insert the field - cumbersome, but it works.
Can anyone help me? |
|
| Back to top |
|
 |
pitonyak Administrator


Joined: 09 Mar 2004 Posts: 3618 Location: Columbus, Ohio, USA
|
Posted: Thu Aug 03, 2006 11:43 am Post subject: |
|
|
Is the default system date format used for this? If so, can you change your default system format (I mean, on your computer). _________________ --
Andrew Pitonyak
http://www.pitonyak.org/oo.php |
|
| Back to top |
|
 |
jrkrideau Super User

Joined: 08 Aug 2005 Posts: 6733 Location: Kingston ON Canada
|
Posted: Thu Aug 03, 2006 11:47 am Post subject: Re: Changing default date format in Writer? |
|
|
| PromptJock wrote: | Simple question: when I insert a Date field in Writer, it appears in "MM/DD/YY" ("08/03/06") format. I want to CHANGE the default Insert Date Field format to "text date" format (i.e. "August 3, 2006").
I've searched all the Help topics and configuration options in OpenOffice and Writer and can't find the way to do it. Right now, I have to manually change the format after I insert the field - cumbersome, but it works.
Can anyone help me? |
Insert >Special Characters> Document > Date ? I think it will do what you want. _________________ jrkrideau
Kingston ON Canada
Currently using Windows 7 & OOo 3.4.0 and Ubuntu 12.04 & LibreOffice 3.5.2.2 |
|
| Back to top |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8984 Location: Lexinton, Kentucky, USA
|
Posted: Thu Aug 03, 2006 11:53 am Post subject: |
|
|
| Quote: | | Is the default system date format used for this? | My test under Widows indicates it is not. |
|
| Back to top |
|
 |
KSpringer Newbie

Joined: 14 Jun 2006 Posts: 2
|
Posted: Thu Aug 03, 2006 5:13 pm Post subject: |
|
|
I'm using 2.0.2 so this may be different for 2.0.3.
I have to use: Insert>Fields>Other>Date
and choose the type of date format you want.
Hope this helps. |
|
| Back to top |
|
 |
dfrench Moderator

Joined: 03 Mar 2003 Posts: 1605 Location: Wellington, New Zealand
|
Posted: Thu Aug 03, 2006 6:06 pm Post subject: |
|
|
| Assuming that you are using the command Insert > Date from the menu then I think that the only variation is from the locale setting. You could change your configuration by creating a macro to do the Insert>Fields>Other>Date and modifying the menu bar (in Tools > Options) to replace the Insert>Fields > Date by an entry assign to your macro. |
|
| Back to top |
|
 |
PromptJock Super User


Joined: 26 Jul 2006 Posts: 741
|
Posted: Fri Aug 04, 2006 7:50 pm Post subject: |
|
|
| dfrench wrote: | | Assuming that you are using the command Insert > Date from the menu then I think that the only variation is from the locale setting. You could change your configuration by creating a macro to do the Insert>Fields>Other>Date and modifying the menu bar (in Tools > Options) to replace the Insert>Fields > Date by an entry assign to your macro. |
This is the command sequence I'm using. However, MSword allows one to assign one's preference for date/time displayed with the "Alt+Shift+D" command. One sets the default in word by "Insert, date and time", highlights the desired "default" date/time format, then click the "Default..." button at the lower-left of the opened pane. I didn't closely look to see of Writer's "Insert, date and time..." has that same feature.
If it does, then I've probably just answered my own question and, again, wasted valuable disk space on the Forum's server. If it doesn't, perhaps this would be a good feature to add to the next update release of Writer.
Thank y'all again for your time and trying to assist me while I still "get the hang" of OpenOffice.... |
|
| Back to top |
|
 |
dfrench Moderator

Joined: 03 Mar 2003 Posts: 1605 Location: Wellington, New Zealand
|
Posted: Fri Aug 04, 2006 9:38 pm Post subject: |
|
|
What I had in mind was creating a macro to do your insert date and assigning it to the keystroke. I found that recording a macro works for this giving a macro of
| Code: | sub Main
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(5) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Type"
args1(0).Value = 0
args1(1).Name = "SubType"
args1(1).Value = 1
args1(2).Name = "Name"
args1(2).Value = ""
args1(3).Name = "Content"
args1(3).Value = "0"
args1(4).Name = "Format"
args1(4).Value = 5075
args1(5).Name = "Separator"
args1(5).Value = " "
dispatcher.executeDispatch(document, ".uno:InsertField", "", 0, args1())
end sub | Your milage may vary, recorded macros do not always come out as expected. The format arg sets the date layout.
Save that in your macro library so that it available to you always and not just for the current doc.
Assign it to an available keystroke combination using Tools Customize Keyboard. I do not think that ALT keys are available here but you can use CTRL-SHIFT-....
You might like to review the use of macros and keyboard assignment posts on this and the api and macros forum as well as the HELP |
|
| Back to top |
|
 |
PromptJock Super User


Joined: 26 Jul 2006 Posts: 741
|
Posted: Fri Aug 04, 2006 10:41 pm Post subject: |
|
|
| dfrench wrote: | What I had in mind was creating a macro to do your insert date and assigning it to the keystroke. I found that recording a macro works for this giving a macro of
| Code: | sub Main
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(5) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Type"
args1(0).Value = 0
args1(1).Name = "SubType"
args1(1).Value = 1
args1(2).Name = "Name"
args1(2).Value = ""
args1(3).Name = "Content"
args1(3).Value = "0"
args1(4).Name = "Format"
args1(4).Value = 5075
args1(5).Name = "Separator"
args1(5).Value = " "
dispatcher.executeDispatch(document, ".uno:InsertField", "", 0, args1())
end sub | Your milage may vary, recorded macros do not always come out as expected. The format arg sets the date layout.
Save that in your macro library so that it available to you always and not just for the current doc.
Assign it to an available keystroke combination using Tools Customize Keyboard. I do not think that ALT keys are available here but you can use CTRL-SHIFT-....
You might like to review the use of macros and keyboard assignment posts on this and the api and macros forum as well as the HELP |
Impressive! thank you for your reply.
FWIW, I investigated the "insert, field, date..." sequence and, unfortunately, there's no option to "default" the date input format like MSWord does. However, I'll try recording a macro and see what it does for me.
Again, thank you for your speedy reply.
Addendum: Dateline 8-5-06, 0001
SUCCESS! Thanks to your suggestion, I was able to successfully record a "Ctrl+L" macro (took a few tries to get "everything corrrect") that inserts the "August 5, 2006" format date field (fixed, of course!) AND bolds it, underlines it, then "newlines" (I use the "long" date to set off separate entries). FWIW, I had a "V8 moment" (SLAP! on forehead, if you remember the old commercial) and should've'en able to figure it out on my own. The effects of getting older, I guess.
Anyhoo, THANK YOU AGAIN for your assistance. Someday, I might get as good as you in helping others out with OpenOffice....
I hope you (and everyone else who replied) have a great weekend! |
|
| Back to top |
|
 |
|