Mike’s Linux Desktop Experiences

February 7, 2008

Automated Posting from OO to WordPress

Filed under: OpenOffice,wordpress — Mr. Mike @ 7:00 pm
Tags:

I’ve been tracking all my experiences in OpenOffice. I need a way to upload/import them with formatting and screenshots into WordPress. I’m probably asking for too much, but one would hope that OO and Linux with its scripting capabilities could help me do this fairly painlessly.

Somebody did it, but it seems to be only for Win32 and MacOS.

http://ice.usq.edu.au/presentations/demos/try_ice_2x_for_wp.htm

I was able to get OO to automate exports of files a few days back. I can’t find the document where I wrote all about it, but I should be able to figure out and document how to do it again…

Maybe WordPress’ automated import features will help me out. Hmm..

http://www.oooforum.org/forum/viewtopic.phtml?t=3549


Sub FilterNames        oFF = createUnoService( "com.sun.star.document.FilterFactory" )

   oFilterNames = oFF.getElementNames()
    ' Now print the filter names.

'   For i = LBound( oFilterNames ) To UBound( oFilterNames )

'      Print oFilterNames(i)

'   Next

   ' Create a Writer doc and save the filter names to it.

   oDoc = StarDesktop.loadComponentFromURL( "private:factory/swriter", "_blank", 0, Array() )

   oText = oDoc.getText()

   oCursor = oText.createTextCursor()

   oCursor.gotoEnd( False )

   ' Print the filter names into a Writer document.

   For i = LBound( oFilterNames ) To UBound( oFilterNames )

      oText.insertString( oCursor, oFilterNames(i), False )

      oText.insertControlCharacter( oCursor, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False )

   Next

End Sub

Threw that into Tools/Macros/OpenOffice Basic under a new subroutine called FilterNames

screenshot-unsaved-document-1-openofficeorg-writer.png screenshot-my-macros-dialogsstandard-openofficeorg-basic.png

  mike@whitetower:~$ soffice "macro:///Standard.Module1.FilterNames()"

It generates a very long, impressive list of filters, but… none of them seem to be anything that WordPress can do. Mediawiki seems useful though.

I’d do it all manually if the desktop environment wasn’t so damned sluggish.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: