This VBA macro for Microsoft word will put JSP Wiki formatting on document.  The original (which required some tweaks) was found at []
Added conversion of hyperlinks to the macro. The updated macro is attached as WikiMacros.bas.
-Julian Sinai

Could it be extended to deal with embedded images?

Do you Have something like this for a excel file, I am sure it would really help!


Unfortunately the files uploaded have been vandalized, so anyone got a fresh copy?

--[monsoon|], 25-Apr-2006



You can just download the older versions by clicking the paperclip image...  Or you could restore them yourself!

-- JanneJalkanen


I put the macro in a Word 2004 for Mac template as  Seems to mostly work (except for links with different display names).

--Jim White, 15-Jun-2006


Has anyone ever seen a plug-in/macro/or a process to go the other way?

I'd like to use JSPWiki to write Design Documents then export the pages into a Word Doc which could be presented to the client.  If I cut and paste into Word directly, I get the Wiki's formatting which is not bad (I use the smallpiece skin) but I might need to adhere to a standard format.

-- MartinHache


I've made some changes to the macro to make it easier to use for my team.  We are converting lots of project docs from Word to JSPWiki and most of the users are not programmers.  The major changes are:
*Refactored the code so it's a little easier to work with (for me, YMMV).
*Put all the wiki formatting codes into constants.  May make refactoring for other wikis easier.
*I was uncomfortable with the macro changing the original document (too easy to destroy it), so the macro now opens a new doc, copies the original to it and performs the conversion on that.  I added a line to close the new document as well, but commented it out.  Uncomment the line to have the wiki text just magically appear on the clipboard.
*I did some work to enhance table conversions.  Rows that are formatted as all __bold__ will be converted to header rows.  Italics and underline should be converted correctly in tables.  Line breaks should be handled correctly in cells.

I may also write a batch conversion program based on the macro.  It would be the kind of thing you would point at a directory to convert all the Word files in the tree.  Would anyone else be interested in something like that?

-- Jeff Grimshaw


Love the modifications/corrections you were able to make, however I think I found a bug (using [MoreWikiMacros.bas]). Since I know nothing about VBScript, I'm hoping someone here can fix it.

There is something seriously wrong with the Bold function:

*If Boldface is used in the middle of a paragraph, the script gets caught in a loop and crashes Word.
*If Boldface is used at the beginning of a paragraph, it creates about 20 sets of double underline {{{__}}} around the entire paragraph. This doesn't loop indefinetly, but makes a mess where none of the other scripts do.

There is also something wrong with the List Number conversion - it just plain doesn't work. My numbered lists (using just the Numbering button on the toolbar) are left behind and not converted. Am I doing something wrong with my document formatting?

Since this is the only script that does Tables correctly, I'm stuck.

Can anyone help fix this?

-- Carolinne
I ran into the same problem (stuck in loops) in a word file I was attempting to convert, so I corrected the problem.  Runs fine in the file I was converting, but not tested on other Word files.  Uploaded as [Word2Wiki3.bas].
\\Scott\\ 08/08/2007\\


If you could create a batch converter I believe a lot of companies will thank you from the bottom of their hearts. :D.
So yes please, by all means create one!

--[Geoff Williams|], 05-Jun-2007

Added conversion of color, code, paragraphs and pictures. The updated macro is called Word2JSPWiki.bas
*Open the Word document
*Select menu __Tools -> Macro -> Visual Basic Editor__ or press Alt+F11
*In the new window that opens select menu __File -> Import File...__ or press Ctrl+M
*Import the file __Word2JSPWiki.bas__, or open the attachment.
*To convert the document select menu __Run -> Run Macro__ or press F5
*Select Word2Wiki and click __Run__
*A new Word window is created named ''Document1''. If the text in the document is not already selected press Ctrl+A to select all text and paste into the new wiki page
*Check the wiki markup and fix if necessary.
*Picture handling is pretty primative - will replace pictures with sequential jpeg or gif file references (image002.jpg, image004.jpg, image005.gif etc) and save a copy of the original file as html in the parent dir.
 From the wiki, load up the jpeg and gif files from the "<docname>_JSPWiki_files" folder and if images not too exotic, and no images are re-used, you are sweet. Otherwise, just go through and fix the references, because file number sequences will be out. Extensions (.gif or .jpg) should be good.
*I am a techie, converting tech docs. This macro will automatically convert blocks of "Courier" and "Courier New" font to code blocks. If you don't want this - disable the ConvertCode subroutine call (add ' in front).

-T Goodwill


Checked in a new version as [Word2JSPWiki_RRG.bas] with the following changes:
* Added Converting BoldItalics 
* Added support for .docx (instead of just .doc files)
* Changed line break from {{{ \\ }}} to double space
* Fixed Numbered lists 
* Calls the function to delete any shapes created using Word.
* Fixed some other random things to my liking

- Rachana Gaddam, 20-Dec-2011