Word2WikiPlus - Standalone MS Word 2 Moin-Moin Wiki converter

This code is based on AlexanderAgibalov 's StandaloneMicrosoftWordConverter (v0.5), then code from MicrosoftWordConverter (v2) was merged (as this had some additional beneficial features). Finally, the code was optimised and a few minor extra features were added.

It supports old and new moinmoin syntax and can convert multiple files during one session.

Provided below is the Visual Basic source code (and interop assemblies for Office 2002-2010 if not embedded), plus the compiled binaries. It can be easily compiled using the free Microsoft Visual Basic 2010 Express.

StuartGillibrand

How to use

  1. start application, press Start and select a single / multiple .doc file(s)
  2. wait for the conversion process (a progress bar is provided)
  3. the result will be shown in a new tab
  4. copy text from the tab to the Wiki text editor
  5. move images; images can be found in the same directory as the original doc file (in a zip file)

Tip

If the program always hangs during the conversion and you see a AccessViolationException or 'Object not set to valid reference' error, you've found the nasty bug described here.

In order to resolve it, you need to open a Command Prompt with administrative right and run a command like this one:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe "C:\Program Files\Microsoft Office\Office12\MSWORD.OLB"

Download

v 1.0.3 - 23.9.2013 by NicoZanferrari

(tested with WinXP/Win7 + MS Office 2003-2007-2010; requires Microsoft .NET framework 4)

* fixed "images in headers" conversion  (thanks to eugen@eugenalbiker.de)

v 1.0.2 - 21.8.2012 by NicoZanferrari

(tested with WinXP/Win7 + MS Office 2003-2007-2010; requires Microsoft .NET framework 4)

* added conversion for underline, strikethrough, superscript, subscript
* ordered lists were not processed right if useMoinTOC was checked
* removing underscore wrong conversion in hyperlinks

v 1.0.0 - 16.8.2012 by NicoZanferrari

(tested with WinXP/Win7 + MS Office 2003-2007-2010; requires Microsoft .NET framework 4)

* MAJOR release - .Net 4 allows to produce a single .EXE by embedding the DLLs
* added check and info messages for AccessViolationException
+ additional works by Eugen Albiker:
* changed objFolder = objShell.NameSpace(zipFile.ToString) (eugen@eugenalbiker.de)
* correct Hyperlinks conversions (eugen@eugenalbiker.de)
* fixed "empty heading" conversion (eugen@eugenalbiker.de)

v0.3.3 - 21.11.2011 small changes by NicoZanferrari based on v0.3 of StuartGillibrand

(tested with WinXP/Win7 + MS Office 2003-2010; requires Microsoft .NET framework 4)

* Built for Windows 7, in order to prevent errors with multiple images
* Added .docx (Word 2007) support
* <<+>> new syntax choosen by default (also in TableOfContents)
* winword.exe process now is closed correctly after being used
* fixed "unsupported method" fatal error with Word 2010
* fixed some unhandled exceptions on Win XP

v0.3 - 30.10.2009 (tested with WinXP + MS Office 2002 + 2003 only)

Added support for Moin "automatic table of contents"
Prevents infinite loop on certain empty headers.

v0.2 - 22.09.2009

Fixes attachment syntax errors.

v0.1 - 18.09.2009

Initial version.

Discussion

Date: 19-09-2009

Today i just test this tool(for moinmoin_184) only for following text with MS-2003. I have made first and second headings with normal text in word document.

First Heading
Normal text
Second Heading
Normal text
Picture
here was my picture

then i run your exe file and upload my document and i got following output. The output for the text was very nice but this exe does not write the complete wiki code for image. Here is the wiki-code which i got after running your tool Word2Wiki.exe:

= Here is the first heading =
Normal text.

== Second heading ==
Normal text

Picture

attachment:junk_fig01.png

actually it should be compile like this for pictures.

{{attachment:junk_fig01.png}}

BTW it is nice tool to compile word document to wiki. i thank to you for such a nice tool for sharing with moinmoin. I will test this tool on Monday for complicated word docs. :)


Date: 22-09-2009

Thank you for the feedback and comments :)

I have corrected the attachment syntax error; new source and binaries are available above (v0.2).

StuartGillibrand


MoinMoin: Word2WikiPlus (last edited 2013-09-23 13:13:19 by NicoZanferrari)