This is a macro for Microsoft Word that helps you convert Word documents into UseMod
- Launch Microsoft Word, go to Tools | Macro | Visual Basic Editor (Alt+F11)
- right mouse button on the Normal project (within the Project Explorer window - if you don't see that window, go View | Project Explorer (Ctrl-R)), do an Insert | Module
- Open the /source code in a new browser window
- copy & paste the source code into the newly created module (make sure not to take bring along wiki markup in this paste - just get the code).
- go File | Save Normal, then File | Close and Return to Microsoft Word
- From any Word document, go </b>Tools | Macro | Macros... </b> (Alt+F8) and run the "WordToUseModWiki?" macro - the text of the document is converted (in-place) and copied to the clipboard.
- Paste to your UseModWiki page
It handles conversions for the following:
- Bullet lists
- Numbered lists (No fancy styles or continuations)
adapted from a [TikiWiki] [extension]
- FIXED 6-Mar-2005: headings 1-3 are all converted to level 1 headings
- an extra blank line is left between list items, these need to be removed manually after the conversion
- single newlines in the Word original are not converted to <br>, these need to be inserted after the conversion
This looks a useful basis for converting Word documents to wiki.
I have always advocated linking to existing Word documents rather than duplicating the information inside the wiki except where the Word document is being replaced by the wiki page.
In the later case this macro gives a useful starting point. --BrianHunter
I have added processing for table of contents...
Instructions to add TOC processing to the macro
add a call to ConvertTOC? after the H1/H2/H3 calls
change the headings to be numbered headings
i.e. include a #
.InsertBefore? "== # "
.InsertAfter? " =="
make the headings 1 level less (as heading 1 is not included in a TOC)
i.e. heading 1 becomes heading 2; heading 2 becomes heading 3 etc
add this subroutine at the end of the macro
Private Sub ConvertTOC()
.Text = "Table of Contents"
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Forward = True
.Wrap = wdFindContinue
Do While .Execute
If InStr(1, .Text, vbCr) Then
' Just process the chunk before any newline characters
' We'll pick-up the rest with the next search
' Don't bother to markup newline characters (prevents a loop, as well)
If Not .Text = vbCr Then
.Font.Bold = False