Ask Your Question

Philbowen's profile - activity

2015-08-10 22:50:13 +0200 received badge  Famous Question (source)
2015-05-18 06:21:04 +0200 received badge  Notable Question (source)
2015-05-15 17:03:58 +0200 received badge  Popular Question (source)
2015-05-15 14:22:04 +0200 answered a question I have recorded a "save as" macro but I need the macro to save the date and time in the file name, I keep getting a sintax error. Can anyone help please?

Thanks for pointing out my spelling, it had been a long day. I have copied the coding but I cant get the SYNTAX right, to be able to save each time with a date and time within the file name. Could some one look at the code and work out how to get it to add "NOW" to the file name "PLANT%20CHECKv1.2.4.odt

sub P_DRIVE_SAVE_AS
    dim document   as object
    dim dispatcher as object
    document   = ThisComponent.CurrentController.Frame
    dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

    dim args1(1) as new com.sun.star.beans.PropertyValue
    args1(0).Name = "URL"
    args1(0).Value = "file:///P:/Engineering/Plant%20Check%20Results/PLANT%20CHECKv1.2.4.&"NOW"().odt"
    args1(1).Name = "FilterName"
    args1(1).Value = "writer8"

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


end sub

[edit code for readability Karolus ]

I think the error is the dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args1())

Thanks Phil

2015-05-14 16:43:44 +0200 asked a question I have recorded a "save as" macro but I need the macro to save the date and time in the file name, I keep getting a sintax error. Can anyone help please?

System used id windows 7 and 8