Loren M. Lang <lorenl <at> alzatex.com> writes:
> 
> > Loren M. Lang wrote:
> > >I have a hundred or so powerpoint presentations or so that I'd like to
> > >convert to openoffice format and possibly back again, is there an easy
> > >way that I can write a script that simply opens a powerpoint and save it
> > >as openoffice format, or vice-versa?  I can't seem to figure out how to
> > >save it as a specific format.
> > >
I just knew Yoda would be on the right side of the software issue.  The
scripts below will respectively export an OO Impress presentation to
powerpoint and save a powerpoint doc as an Impress presentation, assuming a .xxx
extension to the filenames.  They have not pasted altogether correctly because
of the length of lines in the posting form - the following line for
example should be part of the preceding line (occurs twice):
( "com.sun.star.presentation.PresentationDocument" ) Then
They only work for an open document.  To open a document without having its name
would probably require a bash script - I don't know.

Exporting to .csv may be more complicated.  You would increase your chances
of getting macro assistance if you also post on the Macros and API forum:
http://www.oooforum.org/forum/viewforum.phtml?f=3

Sub makePPT
'This assumes a three character extension following a point - eg .odp
oDoc = StarDesktop.getCurrentComponent()

If NOT oDoc.SupportsService
( "com.sun.star.presentation.PresentationDocument" ) Then
        Msgbox "Not a presentation document" : Exit Sub
End If

If NOT oDoc.hasLocation Then
        Msgbox "Save document before proceeding" : Exit Sub
End If

sUrl = oDoc.Url

'This sequence gets a valid url with extension .ppt  
sName = Left ( sUrl, Len ( sUrl ) - 4 )
sUrl = ConvertToURL ( sName & ".ppt" )

aArgs1(0).Name = "InteractionHandler"
aArgs1(0).Value = ""
aArgs1(1).Name = "FilterName"
aArgs1(1).Value = "MS Powerpoint 97"

oDoc.storeToURL ( sUrl , aArgs1() )

End Sub

Sub makeImpress
'This assumes a three character extension following a point - eg .ppt
oDoc = StarDesktop.getCurrentComponent()

If NOT oDoc.SupportsService
( "com.sun.star.presentation.PresentationDocument" ) Then
        Msgbox "Not a presentation document" : Exit Sub
End If

If NOT oDoc.hasLocation Then
        Msgbox "Save document before proceeding" : Exit Sub
End If

sUrl = oDoc.Url

'This sequence gets a valid url with extension .ppt  
sName = Left ( sUrl, Len ( sUrl ) - 4 )
sUrl = ConvertToURL ( sName & ".odp" )

oDoc.storeAsURL( sUrl, aNoArg() )

End Sub




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to