Help:Word2Wiki

From EcoliWiki
Jump to: navigation, search

Word to Wiki using Word macros

All of the Word to Wiki converters that we've found are for PC only and require the Microsoft Photo Editor that comes with some Microsoft packages if you want to convert a document with a picture in it. This one has the following features:

  • Replaces smart quotes/double-quotes with dumb equivalents
  • Escapes the following characters: * # { } [ ] ~ ^^ | '
  • Converts external hyperlinks
  • Converts H1-H5 headings
  • Converts bold/italic/underline/strikethrough/superscript/subscript formatting
  • Converts bulleted/numbered lists
  • Converts simple tables

First, you will need to download the macro library. You can do that by right-clicking on the link and saving the following file. If it asks to save it as a text, select all files on the "Save As Type".

Next, you need to install this file and allow for MS Word to utilize this library.

To Install:

Step 11.JPG

Start MS Word and Start the Visual Basic Editor. This can be found by going to to the Tools Menu, selecting Macro, then Visual Basic Editor. As a short cut, Alt+F11 works.


Import1.JPG

Once you've started the VBE, open the macro library by going to the File Menu and then selecting import file.


To convert a document

Run macro1.JPG

To use the converter, open the file you wish to convert.

To run the Word2MediaWiki macro, you'll need to start the Macros dialog. This is under the Tools menu, Macros and then Macros (shortcut Alt+F8). Select Word2MediaWiki. Select run.

Before

The macro will do it's job and run. After it's finished, you'll have a document with wiki mark-up.

Select all on the document and paste it into the wiki document. Proceed as usual with the wiki document.

After


Word or Excel to wiki via HTML

The macro approach described above has idiosyncratic behavior on different versions of Word on different platforms. Some users have been able to get it to work, while others can't. An alternative approach is to convert your documents to HTML and then convert the HTML to wikitext.

Saving as HTML

Word and Excel have options to save documents as HTML.

  • In Office 2004 for the Mac use the Web Page Preview under the File menu or Save as Web Page
  • In ...

If you preview a web page, you can get the HTML from View Source in your browser. Copy it onto the clipboard. If you saved the website as a file, you can open it in a text editor and copy it.

Microsoft HTML is full of extra garbage, and it can't be pasted directly into the wiki without creating something that needs a lot of cleaning up. Fortunately, converters clean up most of the problems.

Converting

There are Perl modules for converting HTML to wiki markup. Fortunately, there are websites that implement this for those of us who aren't Perl programmers.

  • This site at dyndns.org has a text box where you can paste HTML. Click the Convert HTML to Wiki Markup button and it reloads with the wikitext and the original HTML in a pair of text boxes. The site cleans out most of the extra Microsoft junk in the HTML. You can copy the wikitext and paste it into an EcoliWiki edit box (or any other Mediawiki site).
  • another converter at seapine.com

Excel to Wiki via CSV

Excel tables can be saved as CSV files, which are comma separated values. The CSV text can be converted to wiki tables using this website.

See also