| View previous topic :: View next topic |
| Author |
Message |
tvandel Newbie

Joined: 06 Jun 2008 Posts: 2
|
Posted: Fri Jun 06, 2008 2:27 pm Post subject: Issue opening wk1 files |
|
|
We still have a conversion tool running on an old system that creates xls files which are in fact the old Lotus wk1 format.
Openoffice is able to open them, but I've a problme in batch mode
As users can no longer open these files in Excel 2007 I'm just trying to put in place a script that would call an OOo basic macro to convert them in a more recent Excel format.
i'm using the macro below that work fine for other formats but have an issue to open wk1
Any help much appreciated .. should I use a filter .. and if yes which one?
Thanks
TV
Sub convrt( cFile )
Dim adresseDoc As String
Dim propFich()
Dim oDoc()
cURL = ConvertToURL( cFile )
oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, (Array(MakePropertyValue( "Hidden", True ),))
cFile = Left( cFile, Len( cFile ) - 4 ) + ".xls"
cURL = ConvertToURL( cFile )
oDoc.storeToURL( cURL, Array(MakePropertyValue( "Hidden", False ),_
MakePropertyValue( "AsTemplate", False ),_
MakePropertyValue( "FilerName", "MS Excel 97" ) ) )
oDoc.close( True )
End Sub
'----------
' Create and return a new com.sun.star.beans.PropertyValue.
'
Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
Dim oPropertyValue As New com.sun.star.beans.PropertyValue
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
EndIf
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
EndIf
MakePropertyValue() = oPropertyValue
End Function |
|
| Back to top |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
|
| Back to top |
|
 |
tvandel Newbie

Joined: 06 Jun 2008 Posts: 2
|
Posted: Sun Jun 08, 2008 11:10 am Post subject: |
|
|
Hi,
Thanks for the prompt reply ..
I already tried to get the correct filter name using queryTypeByDescriptor which was : writer_Lotus_1_2_3_10_WIN_StartWriter
But it was not enough ...
Anyway after doing some more tests I've added the following FilterOptions:
"FilterOptions" Value="IBM_850"
.. and my wk1 file has opened and then been converted to xls!
I'll just have to make sure the file content is correct . do you know were I can find the list of character set? and also it seems the is an option of the loadComponentFromURL method called 'characterset': what's the difference between this option and the cahrset specified in the FilterOption?
Note the "FilterName" is working either with "Lotus" or "writer_Lotus_1_2_3_10_WIN_StartWriter"
Thanks again for your help (.. and stil a lot to learn !)
TV |
|
| Back to top |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
|
| Back to top |
|
 |
alex.g Newbie

Joined: 12 Jul 2012 Posts: 1
|
Posted: Thu Jul 12, 2012 4:44 am Post subject: |
|
|
Hi!
I want to copy content of cells from a OpenOffice Calc sheet in a "IBM 850" format, to be compatible with another system I use.
Do you know something for this?
Thanks!
alex.g |
|
| Back to top |
|
 |
|