It's better when it's simple

User Tools

Site Tools


Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community

Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy


This is an old revision of the document!

OenOffice Macro

See also:

I just started to use DokuWiki and was looking for an OpenOffice to DokuWiki Converter, so after searching the web and trying I noticed that none of the existing converters was converting embedded pictures (using OpenOffice 3 and Windows XP)!

But I remembered that the Writer2MoinMoin Converter did, so I checked the Macro and found the difference.

I am absolutely no expert in Macros or anything, but I thought I would share the work I did. I basically added the routine to parse for the embedded pictures and put it in the DokuWiki Macro. I don't know how to make a super easy installable extension or anything else with this, but maybe someone knows and can improve this even further?

  * The Original routine is Copyright © 2005 Ian Laurenson
  * Improvements and replacements for MoinMoinWikiEngine: 2005 KlausHeinisch
  * Further improvements for MoinMoinWikiEngine: 2005 Marc Santhoff search for "[ms"
  * both put together by RG in December 2008

Since I can't upload anything I just put the changes I made in here:

const sTYPE_PNG = ".png"

change the line:
if oTextElement.supportsService("") Then

with this:
' [ms, detecting graphics attached to paragraph]
	if oTextElement.supportsService("") Then
		en = oTextElement.createContentEnumeration("")
		while en.hasMoreElements()
			el = en.nextElement()
			if el.supportsService("") then
				if InStr(el.GraphicURL, "file:///") > 0 OR InStr(el.GraphicURL, "http://") > 0 then
					subAddString(sPICTURESTART & FileNameoutofPath(el.GraphicURL) & sPICTUREEND)
				else ' embedded picture, no location known
					subAddString(sPICTURESTART & el.getName() & sTYPE_PNG & sPICTUREEND)
	' [ms, end]
tips/openofficemacro.1298284092.txt.gz · Last modified: 2011-02-21 11:28 by HåkanS