Word to wiki converter

From Bogleheads
(Redirected from Word to Wiki Converter)
Jump to: navigation, search

It's not necessary to learn wiki markup language to edit the wiki. Microsoft Word users can install a macro that converts an MS Word document into wiki language automatically. The only restriction is that the Normal template be used.

The currently released macro is available from MediaWiki. However, it is not designed to work with Word 2007 and has some bugs.

An updated version of this macro, which supports Word 2007 and contains numerous updates (see the discussion page) is available on Google Docs. Download Word2MediaWikiPlus.zip.(The file will download without browser cookies enabled.)

Word2MediaWikiPlus.zip contains 2 files:

  1. Word2MediaWikiPlus.doc, the instructions which contain the macro code. No need to install anything, the macro runs from this file.
  2. Example page.doc, the Word to Wiki Converter Example

The instructions shown below were were entered in this wiki page using the Word2MediaWikiPlus (updated) macro. The non-convertible objects in the table below are the command buttons which run the macros and are not expected to be converted.

Tip: This macro is very useful for converting complex tables. See the example page.


Title page

Word2MediaWiki Macros – click on the buttons below


 MediaWiki2WordPlus Converter found a non convertible object.



 MediaWiki2WordPlus Converter found a non convertible object.


Always copy the file to convert under a new name so you have a backup


Configure the Macro

First, configure the macro. Click the "Configure the Macro" button above and a dialog box appears as shown below. Edit the dialog box so it looks like the picture.

This only has to be done once on each PC used. If the macro is run on a different PC, or, the login is changed, then run "Configure the Macro" again. Changes are stored in the registry, which is different for each user (login) and PC.

Language: English. A number of other languages are available, but have not been tested.

Image path: This tells the macro where to store the images extracted from your article. Although the location can be anywhere, the default folder is "My Pictures\wiki".

"My Pictures" can be stored on any drive. If you're not sure which drive "My Pictures" is located, delete the entry and select OK. Rerun the macro and Image Path will be filled in with the correct drive letter for you. The figure shows "My Pictures\wiki\ located in drive E:.

Wiki URL (without article name): Since nothing will be automatically uploaded to the wiki (not recommended and it may not work), we can tell the macro that there is no Wiki URL.

Under Wiki URL (without the article name), delete the entries for test and production. When the entries are deleted, a single "/" will appear.

Wiki Image Conversion and Upload: Enter 1 for Firefox, 2 for Internet Explorer. Uploading won't work, but it helps to have the right information just in case.


Instructions 02.png


Prepare the wiki page for the article

In the wiki, create a new page or edit an existing page. In either case, the edit box should be ready to accept the text.

Run the Convert to Wiki Macro

Click on "Convert to Wiki". If you have another Word file open at the time, the macro will assume that the other open file is the one to convert. The macro jumps right to the conversion dialog box.

If no other Word document is open, you will be presented with a dialog box informing you that a document should be loaded to convert. Hit OK. Another dialog box appears. Navigate to the folder with the file to convert and hit Open. The file opens in a new document window and the conversion dialog box appears.

(If you have renamed this instruction file to something other than "Word2MediaWikiPlus", the conversion will be performed on this file, which is not want we want.)

Instructions 01.png

Article Name: Enter the name of the article. The name entered here is used to name the extracted image files.

Category: Enter the category(ies) of the article. Every page needs at least one category. Use a comma "," to separate multiple categories. Keep the Article Category box checked as shown.

As images won't be uploaded, leave the Image Category and like article category boxes checked. The Image categories don't need to be changed.

If a category is does not exist in the wiki (for example, it's mistyped), it will appear as a red link in the wiki. This needs to be fixed by either changing the category or creating the category in the wiki.

Text conversion:

  • Convert font size: uncheck this box so the fonts will all appear the same size in the wiki.
  • Number lists manual (like word shows): Leave this unchecked unless you want to force the numbering to be exactly as shown in word. Nested lists may not appear in the wiki correctly if this box is checked.

Image Handling: If desired, the macro conversion will automatically convert images and save them in a format that can be handled by the wiki. Uncheck this box if you already have the image files ready for the wiki.

If this box is checked, a folder with the directory path of Image path, as entered in the configuration macro, is created. The notes below describe how the files are saved.

Note: If PowerPoint is installed, the macro will open PowerPoint for some of the image conversions.

Leave the Image upload to wiki box unchecked.

Wiki syntax will be created where the images should be, but they won't work unless they point to the image uploaded to the wiki.

You can either upload the file to the wiki first and get the link, or, create the wiki page and go back and edit the bad link later.

Image size: Select resize to document size image to have the image appear as shown in page layout view.

Image max. width: Nothing can be selected here. Not needed for anything.

Select Convert! to start the conversion. The conversion takes place. The macro has already copied the converted article into memory, ready to be pasted into the wiki.

Image Handling Notes

When images are extracted, files are created in several sizes and formats, as well as full-size. This macro can be very useful as an image extraction tool for uses other than editing a wiki.

The files are saved as follows (using the default folder):

My Pictures \ Wiki (folder)

  • (Folder for each converted file, using same name as the file)
    • The extracted full-size image as ArticleName_Number.ext
    • Extra_Formats (folder)
    • Files in 800x600, 1024x768, 1280x1024 resolution as ArticleName_Number-display.ext

Normally, the full-size image should be uploaded. The image link created by the macro contains the appropriate image size.

As an example, the converter will output wiki syntax that looks like this: [[Image:Article_Name_01_624.png|thumb|none|553px]]

When you preview this page, the link will be red. This is the same name as the file that was saved by the macro. Upload this same file into the wiki. When done, the image should appear in place of the link.

Depending on the image, different display resolutions may be better than others. Select the best one and upload to the wiki.

Create the Wiki Page

Paste the converted text into the wiki's edit box. Click on any area inside the edit box and paste the article by either 1) right-click with the mouse and select Paste or 2) Type Control-V (Control key + V).

If the article didn't get pasted correctly into the edit box, simply re-copy the converted article and try again.

  • Delete the unwanted text from the wiki's edit box
  • In the converted document window, select the entire article (Control key + A)
  • Copy the selection (Control key + C)
  • Click on any area inside the wiki edit box and paste the text (Control key + V)

At the end of the article in the wiki edit box, enter the following on a new line: {{Footer}}

This puts the citation template at the bottom of the page. The purpose is to allow anyone to copy this line and paste it into a forum post so that they have a link back to this page. It creates the "Please see (this page) on the Bogleheads Wiki" link.

Select Show preview to review your work. Make as many changes as you need. After each change, select Show preview to check your work. Nothing is saved until you select Save page.

When done, select Save page to commit the changes. Remember to upload your images and fix the links in the new page to point to the uploaded images.

See also