| View previous topic :: View next topic |
| Author |
Message |
Mike Guest
|
Posted: Tue Oct 28, 2003 1:28 am Post subject: A simple macro and a stupid newbie |
|
|
I tried to make a macro with the macro recorder that insert tha actual date in this format "day month year". The problem is that when i try to run it i get a number (37992,43 for 28 ottobre 2003). This field code is recognized as a date (edit -> fields) but it is displayed in a way I don't want. How I can solve the problem?
The code generated is this:
sub data
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 = 0
args1(2).Name = "Name"
args1(2).Value = ""
args1(3).Name = "Content"
args1(3).Value = "0"
args1(4).Name = "Format"
args1(4).Value = 5076
args1(5).Name = "Separator"
args1(5).Value = " "
dispatcher.executeDispatch(document, ".uno:InsertField", "", 0, args1())
end sub
Thanks, Mike[/code] |
|
| Back to top |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8979 Location: Lexinton, Kentucky, USA
|
Posted: Tue Oct 28, 2003 5:12 am Post subject: |
|
|
As far as I know you can't. This has been a bug for some time and I just tried it again in OO1.1 final with the same results as your getting.
Here's a work around that seems to work fine. Insert your date with the desired format. Select the date field and use Edit > AutoText to set it up.
Last edited by JohnV on Tue Oct 28, 2003 4:19 pm; edited 1 time in total |
|
| Back to top |
|
 |
Mike Guest
|
Posted: Tue Oct 28, 2003 8:46 am Post subject: |
|
|
| Thanks. I'll try it. |
|
| Back to top |
|
 |
|
|
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
|