OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Issue opening wk1 files

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
tvandel
Newbie
Newbie


Joined: 06 Jun 2008
Posts: 2

PostPosted: Fri Jun 06, 2008 2:27 pm    Post subject: Issue opening wk1 files Reply with quote

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
View user's profile Send private message
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Sun Jun 08, 2008 4:03 am    Post subject: Reply with quote

Hi,

try http://www.oooforum.org/forum/viewtopic.phtml?p=80918#80918 to determine the correct filter name.

Run it once as given, and a second time with
Code:
sType = oTD.queryTypeByDescriptor(aProps(), true)


Good luck,

ms777
Back to top
View user's profile Send private message
tvandel
Newbie
Newbie


Joined: 06 Jun 2008
Posts: 2

PostPosted: Sun Jun 08, 2008 11:10 am    Post subject: Reply with quote

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
View user's profile Send private message
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Mon Jun 09, 2008 3:35 am    Post subject: Reply with quote

Hi,

see http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options . Lotus is mentioned

Good luck,

ms777
Back to top
View user's profile Send private message
alex.g
Newbie
Newbie


Joined: 12 Jul 2012
Posts: 1

PostPosted: Thu Jul 12, 2012 4:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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