Code: Select all
If .... openoffice then
....
elseif ...... libreoffice then
.....
end ifCode: Select all
If .... openoffice then
....
elseif ...... libreoffice then
.....
end ifCode: Select all
Function ooSetupAllDigitVersion() As String
REM This is completely from Laurent Godard as published in "Useful Macro Information" by Andrew Pitonyak.
REM It's only adapted to my style to not so much expose its migration background.
Dim structNode, providerSrv
Dim arguments(0) As New com.sun.star.beans.PropertyValue
Const providerSrvN = "com.sun.star.configuration.ConfigurationProvider"
Const structNodeN = "com.sun.star.configuration.ConfigurationAccess"
providerSrv = createUnoService(providerSrvN)
arguments(0).Name = "nodepath"
arguments(0).Value = "/org.openoffice.Setup/Product"
structNode = providerSrv.createInstanceWithArguments(structNodeN, arguments())
ooSetupAllDigitVersion = structNode.ooSetupVersionAboutBox
End FunctionCode: Select all
structNode.ooNameIn case of a date control:athena22 wrote:Hi, I am a frequent user of openffice, I immediately go to the problem, I have a file that I open with libreoffice and openoffice, some fields of the form go into error I need to know via macro with which suite I am using the file in order to set the correct code .
Code: Select all
If IsUnoStruct(myControl.getDate() thenBecause of increasing divergence in code base between LibreOffice and OpenOffice, it is likely that _some_ macros will refuse to run on one or other, but at present, most macros should be interchangeable.athena22 wrote:Thanks to both of them, Lupp's solution is excellent. Villeroy you hit the problem, these are date fields created with openoffice and macros don't work on libreoffice. I hadn't thought of using IsUnoStruct UNO Functions.
Thank you all.
They both have their own (often different) set of bugs too... e.g. setPosSize works fine in OO... LO have introduced problems with it.Because of increasing divergence in code base between LibreOffice and OpenOffice
I feel sure LibreOffice ought work on Windows 7: you should explore all the fixes. You may get more directed help by posting to https://ask.libreoffice.org/c/english/5athena22 wrote:Yes, in fact I would like to migrate to libreoffice permanently but on a pc where I installed windows 7 libreoffice I can't install it, it actually installs itself but as soon as I open it it crashes.
I am forced to use both.
Code: Select all
SUB doMyJob()
If isREGEXfunctionAvailable() Then
doItTheEfficientWay(....)
Else
doItByParsingStringsWithInefficientMeans(...)
EndIf
Function isREGEXfunctionAvailable() As Boolean
On Local Error Goto fail
fa = CreateUnoService("com.sun.star.sheet.FunctionAccess")
fa.callFunction("REGEX", Array("","","",1))
isREGEXfunctionAvailable = True
fail:
End FunctionIndeed, a LibreOffice form control has a property "Date" (but not method getDate()) which may be empty whereas a dialog's date control has method getDate and may return a struct with three zeroes when empty.Lupp wrote:A myDateControl not having assigned a valid date will return Variant/Empty for myDateControl.Date. That's not an UNOStruct.
Well, that's the kind of jokes software is playing on us, and I neither like nor easily understand.Villeroy wrote:Indeed, a LibreOffice form control has a property "Date" (but not method getDate()) which may be empty whereas a dialog's date control has method getDate and may return a struct with three zeroes when empty.