No computer access, but my guess its that the problem its that the format is 
set to an integer constant. 

The correct method is to lookup the format index and create the format if it 
does not exist. 

I would explain more, but my phone is slow to use for this. Will have better 
access in a few days if needed.

There is an example in andrewmacro.odt I believe.

Hth

Sent from my Samsung Epic™ 4G

Tom Davies <tomdavie...@yahoo.co.uk> wrote:

Hi :)
Looks like the code didn't get to the list so here it is 

"

REM  *****  BASIC  *****

Sub Main

End Sub






sub Insert_Line_and_Date
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(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "GraphicName"
args1(0).Value = ""
args1(1).Name = "IsSimpleLine"
args1(1).Value = true

dispatcher.executeDispatch(document,
                ".uno:InsertGraphicRuler", "", 0,
args1())

rem
                
----------------------------------------------------------------------
dim args2(5) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Type"
args2(0).Value = 0
args2(1).Name = "SubType"
args2(1).Value = 0
args2(2).Name = "Name"
args2(2).Value = ""
args2(3).Name = "Content"
args2(3).Value = "0"
args2(4).Name = "Format"
args2(4).Value = 5122
args2(5).Name = "Separator"
args2(5).Value = " "

dispatcher.executeDispatch(document, ".uno:InsertField",
                "", 0, args2())

rem
                
----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "Text"
args3(0).Value = ", "

dispatcher.executeDispatch(document, ".uno:InsertText",
                "", 0, args3())

rem
                
----------------------------------------------------------------------
dim args4(1) as new com.sun.star.beans.PropertyValue
args4(0).Name = "Template"
args4(0).Value = "Heading 1"
args4(1).Name = "Family"
args4(1).Value = 2

dispatcher.executeDispatch(document, ".uno:StyleApply",
                "", 0, args4())


end sub

"

Regards from
Tom :)





>________________________________
> From: . <l...@ebookring.net>
>To: Tom Davies <tomdavie...@yahoo.co.uk> 
>Sent: Saturday, 27 October 2012, 18:37
>Subject: Re: off-list  Re: [libreoffice-users] Date changes to a 5 digit number
> 
>
>Tom,
>
>Did my code message get to the list?  I know you replied with it
      but it seems there's no option for me to reply to the list.
>
>Thanks,
>
>Carl
>
>
>
>On 10/27/2012 01:33 PM, Tom Davies wrote:
>
><snip />
>>
>>
>>
>>
>>>________________________________
>>> From: . <l...@ebookring.net>
>>>To: Tom Davies <tomdavie...@yahoo.co.uk> 
>>>Sent: Saturday, 27 October 2012, 18:29
>>>Subject: Re: [libreoffice-users] Date changes to a 5 digit number
>>> 
>>>On 10/27/2012 01:06 PM, Tom Davies wrote:
>>>> Hi :)
>>>> Can you copy&paste the macro's code into a
                reply as text?  If we could see the code then some
                people here might be able to spot the error.
>>>> Good luck and regards from
>>>> Tom :)
>>>
>>>Here's the code-
>>>
>>>REM  *****  BASIC  *****
>>>
>>>Sub Main
>>>
>>>End Sub
>>>
>>>
>>>
>>>
>>>
>>>
>>>sub Insert_Line_and_Date
>>>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(1) as new com.sun.star.beans.PropertyValue
>>>args1(0).Name = "GraphicName"
>>>args1(0).Value = ""
>>>args1(1).Name = "IsSimpleLine"
>>>args1(1).Value = true
>>>
>>>dispatcher.executeDispatch(document,
                ".uno:InsertGraphicRuler", "", 0,
>>>args1())
>>>
>>>rem
                
----------------------------------------------------------------------
>>>dim args2(5) as new com.sun.star.beans.PropertyValue
>>>args2(0).Name = "Type"
>>>args2(0).Value = 0
>>>args2(1).Name = "SubType"
>>>args2(1).Value = 0
>>>args2(2).Name = "Name"
>>>args2(2).Value = ""
>>>args2(3).Name = "Content"
>>>args2(3).Value = "0"
>>>args2(4).Name = "Format"
>>>args2(4).Value = 5122
>>>args2(5).Name = "Separator"
>>>args2(5).Value = " "
>>>
>>>dispatcher.executeDispatch(document, ".uno:InsertField",
                "", 0, args2())
>>>
>>>rem
                
----------------------------------------------------------------------
>>>dim args3(0) as new com.sun.star.beans.PropertyValue
>>>args3(0).Name = "Text"
>>>args3(0).Value = ", "
>>>
>>>dispatcher.executeDispatch(document, ".uno:InsertText",
                "", 0, args3())
>>>
>>>rem
                
----------------------------------------------------------------------
>>>dim args4(1) as new com.sun.star.beans.PropertyValue
>>>args4(0).Name = "Template"
>>>args4(0).Value = "Heading 1"
>>>args4(1).Name = "Family"
>>>args4(1).Value = 2
>>>
>>>dispatcher.executeDispatch(document, ".uno:StyleApply",
                "", 0, args4())
>>>
>>>
>>>end sub
>>>
>>>
>>>
>>>>
>>>>
>>>>
>>>>
>>>>> ________________________________
>>>>> From: . <l...@ebookring.net>
>>>>> To: users@global.libreoffice.org 
>>>>> Sent: Saturday, 27 October 2012, 17:59
>>>>> Subject: [libreoffice-users] Date changes to a
                5 digit number
>>>>>
>>>>> I made a macro that inserts the date (fixed) as
                (for example) "July 30,
>>>>> 2012,"
>>>>>
>>>>> However, after running the macro a fews time
                the date then appears as
>>>>> some 5 digit number.
>>>>>
>>>>> How do I fix this date problem?
>>>>>
>>>>> -- 
>>>>> www.eBookRing.net
>>>>>
>>>>> The designer and maker of the original
                eBookRing
>>>>> The perfect stand for eReaders, iPads, iPhones,
                tablet computers and other electronic devices.
>>>>>
>>>>> Patent Pending
>>>>>
>>>>>
>>>>> -- 
>>>>> For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
>>>>> Problems? 
>>>>> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>>>>> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
>>>>> List archive: http://listarchives.libreoffice.org/global/users/
>>>>> All messages sent to this list will be publicly
                archived and cannot be deleted
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>-- 
>>>www.eBookRing.net
>>>
>>>The designer and maker of the original eBookRing
>>>The perfect stand for eReaders, iPads, iPhones, tablet
                computers and other electronic devices.
>>>
>>>Patent Pending
>>>
>>>
>>>
>>>
>
>
>-- www.eBookRing.net The designer and maker of the original eBookRing
The perfect stand for eReaders, iPads, iPhones, tablet computers and other 
electronic devices. Patent Pending
>
>
-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to