Word to Confluence Converter

Name Word to Confluence Converter
Status Beta
Version 1.0
Product Versions Confluence 1.4+
Author(s) [Nick Sieger], [Mike Cannon-Brookes]
Price Free
Homepage Word to Confluence Converter
Issue Tracking http://developer.atlassian.com/jira/browse/OFCE
Download Script http://svn.atlassian.com/svn/public/contrib/confluence/office-converters/trunk/word/

Intro

This is a legacy plugin. A newer version is contained in the Microsoft Office Add-in.
Unless you have a specific need for the script, we recommend you the Add In instead.

Convert Microsoft Word document content to Confluence markup. This is actually not a Confluence macro but a Word Visual Basic macro. I thought it useful enough to post it here since I suspect others are looking for some Word-to-Confluence functionality. Usage requires a running copy of Microsoft Word that supports Visual Basic macros. (Word 97 or greater? Not sure).

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
  • Preliminary support for images and graphics

Caveats

  • No guarantees, no official support, just like the front page says.
  • No in-document hyperlink conversion
  • May not work well with documents that have highly customized styles/templates. It works best with documents written in the default "Normal" template
  • Nested tables have not been tested and may not function as expected
  • Image/graphics/figures support may be flaky depending on the type of embedded graphic

You have the choice between two main variants of Word2Wiki.  Either Word2Wiki.bas or Word2Wiki.dot.  The later one is based on the first and is a bit more sophisticated.  The following sections describe installation and usage of both variants.

Word2Wiki.bas

Installation

  1. Download the Word2Wiki macro library. At this time you have four options:
    • Word2Wiki.bas - believed to be compatible with most modern versions of Word, tested on Word 2000. No support for conversion of inline images and figures.
    • Word2Wiki_Images_Word2000.bas - Same as above except adds conversion of images. Tested with Word 2000.
    • Word2Wiki_Images_Word2003.bas - Same as above except adds conversion of images, and uses "filtered HTML" support built into Word 2003, which may give better output than the Word 2000 version.
    • Word2Wiki_Images_International_Word2003.bas - Same As above except adds intrnational support, fixing Default Paragraph Font bug with constant WdBuiltinStyle.wdStyleDefaultParagraphFont.
  2. Start Word
  3. Bring up the Visual Basic Editor (Tools->Macro->Visual Basic Editor or Alt+F11).
  4. Make sure the "Normal" node is selected in the Project pane.
  5. From the VBE, import the macro library (File->Import File...) and select the file you downloaded.

Usage

  1. Open a word document to convert
  2. Run the Word2Wiki macro by bringing up the Macros dialog (Tools->Macro->Macros... or Alt+F8), selecting Word2Wiki and clicking Run.
  3. The macro converts the document to Confluence markup and places a copy of the content on the system clipboard.
  4. Switch to a confluence editor and paste the result.

Word2Wiki 2000-2003_x.dot

Installation

  1. Download the Word2Wiki macro library. At this time you have two options:
    • Word2Wiki 2000-2003_A.dot-- Same as above but supports both Word 2000 and Word 2003. Some other enhancements are also included (e.g. Special sequences like '( x )' are escaped to prevent them from being displayed as ).
    • Word2Wiki 2000-2003_B.dot - Same as above with additional macro noFormatBlock which helps formatting blocks as {noformat}. (Some minor bugs were also fixed.)
  2. Open Word and select Tools | Templates and Add-Ins.... Then press button Add and select Word2Wiki 2000-2003_x.dot.

Usage

  1. Be sure that Word2Conf is active if you want to convert a Word document (Within Tools | Templates and Add-Ins... the checkbox must be checked).
  2. If your document contains images you can set their export quality in Tools | Options | Common | Weboptions | Images by setting the Pixel per Inch value.
  3. Open the document you want to transfer and call macro Word2Conf.
    You can use the following button to start this macro:
  4. After using macro Word2Conf you can select blocks within the document which should be formatted as {noformat}. Select a block and run macro This will perform the required changes.
  5. Copy and paste the complete document from Word to a new Wiki page.
  6. If the document contains images, attach those files to the newly created Wiki page.
    • If you have a lot of pictures in your document its quite laboriously to attach all files. In this case you can try Confluence File Uploader which makes it easier to attach many files to a Wiki page.
    • After you have created the page within Wiki and attached all files, you should delete the temporary created *.doc.htm file and sub directory *.doc-Dateien.
  7. Don't save your Word document.

I'm pretty happy with the result so far - I've converted some fairly sophisticated textual documents that required little hand modification.

Comments and modifications are welcome.

Credit is due to the Word-to-TikiWiki converter. This is simply a derivative of that work that's doctored up to produce Confluence markup instead of TikiWiki markup, with some additional enhancements from the Confluence community.

Labels

word word Delete
contentconverter contentconverter Delete
fileimporter fileimporter Delete
microsoft microsoft Delete
converter converter Delete
plugin plugin Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Aug 23, 2004

    Peter Häberli says:

    Thanks for this script, it works very well. Anyway I have two remarks: The scr...

    Thanks for this script, it works very well.
    Anyway I have two remarks:

    • The script doesn't run within a non-english Word (thanks to good internationalization by MS). I could fix it for a german word, but unfortunately I don't know how to fix it in general.
      The problem is the following line of the method WikiConvertBold():
      for an english word:
      .Style = ActiveDocument.Styles("Default Paragraph Font")
      for my german word:
      .Style = ActiveDocument.Styles("Absatz-Standardschriftart")
      I don't know what this is needed for is somehow sets a special font which is named different for the different languages. It should be easy to fix it the same way for other languages just look through the list of available fonts and look for an equivalent of "Default Paragraph Font".
    • Converting tables works better now after I added 5 lines to the method WikiConvertTables(). These lines look for empty cells and add a space between the confluence cell marker ("| |" instead of "||"):
      Private Sub WikiConvertTables()
      Dim thisTable As Table
      For Each thisTable In ActiveDocument.Tables
      With thisTable
      For Each aRow In thisTable.Rows
      With aRow

      For Each aCell In aRow.Cells
      If aCell.Range.Text = Chr(13) & Chr(7) Then
      aCell.Range.Text = " "
      End If
      Next aCell

      .Range.InsertBefore "|"
      .Range.InsertAfter "|"
      .ConvertToText "|"
      End With
      Next aRow
      End With
      Next thisTable
      End Sub
    1. Sep 22, 2004

      Nick Sieger says:

      Thanks Peter, I've attached a new version with your empty cell changes included....

      Thanks Peter, I've attached a new version with your empty cell changes included.

      It's unfortunate about the "Default Paragraph Font" business, but at least it's noted. There's probably another way to accomplish that in VBA, but I'm not an expert, so...

    2. Nov 04, 2005

      Holger Norden says:

      Hi,  I took a look into the object browser. Simply replace .Style = ActiveD...

      Hi,
       I took a look into the object browser. Simply replace
      .Style = ActiveDocument.Styles("Default Paragraph Font")
      with
      .Style = ActiveDocument.Styles(wdStyleDefaultParagraphFont)
      and have fun.

  2. Oct 12, 2004

    Ruben Miranda says:

    Mike, Great script. What are your thoughts on expanding the functionality of t...

    Mike,

    Great script. What are your thoughts on expanding the functionality of this macro to include image support? I don't know VB, but it seems like Word's built-in Word-to-HTML conversion could be used hand-in-hand to support this. If I'm not mistaken, that conversion automatically extracts all embedded images from within the document and saves them inside a "_folder" subfolder. So long as the macro could recognize the name of the embedded image and replace it with !imagename.ext!, all the user would need to do is attach the images in that subfolder to the page they are editing.

    To make a general case, I submit that embedded image support, as least for us, would go a long way towards adoption by the general users. We definitely see the advantage of going with pages over attachments (diffs for example), so we would push our users to convert their "fancy" Word docs into pages. Any way to facilitate that conversion for them is inherently gold for all the users.

  3. Oct 18, 2004

    Nick Sieger says:

    Phillip, this looks fantastic unfortunately I couldn't get it to work in my copy...

    Phillip, this looks fantastic unfortunately I couldn't get it to work in my copy of Word 2000. It was failing on the fs.GetFolder line, with the message "Runtime error 76, path not found". I tried moving those lines below the ActiveDocument.SaveAs statement but still no go. Any ideas?

  4. Oct 21, 2004

    Phillip Bogle says:

    I have added embedded image support to this macro. (Please note this version sup...

    I have added embedded image support to this macro. (Please note this version supercedes the version I sent in an earlier version, which had a bug.)

    The key thing is a new function WikiConvertImages() which does exactly what Ruben describes. You should modify the main Word2Wiki() function to call the new function. After running the macro, you still need to manually upload the converted images, of course.

    Private Sub WikiConvertImages()
        Dim s As shape
        For Each s In ActiveDocument.Shapes
            s.ConvertToInlineShape
        Next
        FileName = Options.DefaultFilePath(wdDocumentsPath) + "\" + ActiveDocument.Name
        FolderName = FileName + "_files"
      
        ActiveDocument.SaveAs FileName:=FileName + ".htm", _
            FileFormat:=wdFormatFilteredHTML, LockComments:=False, Password:="", _
            AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
            EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
            :=False, SaveAsAOCELetter:=False
        
        Set fs = CreateObject("Scripting.FileSystemObject")
        Set f = fs.GetFolder(FolderName)
          
        Dim iShape As InlineShape
        Set fc = f.Files
        i = 1
        For Each f In fc
            If i <= ActiveDocument.InlineShapes.Count Then
                Set iShape = ActiveDocument.InlineShapes.Item(i)
                iShape.Range.InsertBefore "!" + f.Name & "!"
                i = i + 1
            End If
        Next
        
        Shell "explorer.exe " + FileName + "_files", vbNormalFocus
    End Sub
    
    1. Nov 08, 2005

      helios says:

      my method Private Sub WikiSaveAsHTMLAndConvertImages() Dim s As shape ...

      my method

      Private Sub WikiSaveAsHTMLAndConvertImages()
          Dim s As shape
          For Each s In ActiveDocument.Shapes
             If s.Type = msoPicture Then
                s.ConvertToInlineShape
             End If
          Next
          FileName = ActiveDocument.Path + "\" + ActiveDocument.Name
          FolderName = FileName + ".files"
      
          ActiveDocument.SaveAs FileName:=FileName + ".htm", _
                        FileFormat:=wdFormatFilteredHTML, LockComments:=False, Password:="", _
                        AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
                        EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
                        :=False, SaveAsAOCELetter:=False
      
          Set fs = CreateObject("Scripting.FileSystemObject")
          If fs.FolderExists(FolderName) Then
              Set f = fs.GetFolder(FolderName)
      
              Dim iShape As InlineShape
              Set fc = f.Files
              i = 1
              For Each f In fc
                  If i <= ActiveDocument.InlineShapes.Count Then
                      Set iShape = ActiveDocument.InlineShapes.Item(i)
                      iShape.Range.InsertBefore "!" + f.Name & "!"
                      i = i + 1
                  End If
              Next
      
              Shell "explorer.exe " + FileName + ".files", vbNormalFocus
          End If
      End Sub
      
  5. Nov 01, 2004

    Tim Colson says:

    Say there – neat macro, but it does not appear to handle nested bullets from wor...

    Say there – neat macro, but it does not appear to handle nested bullets from word. Any chance that has been added?

  6. Nov 12, 2004

    Nick Sieger says:

    Tim, Nested bullets do work, but you need to use the "promote/demote" commands ...

    Tim,

    Nested bullets do work, but you need to use the "promote/demote" commands that are available in outline mode (also keymapped to Alt+Left/Right Arrow) rather than the "increase/decrease indent" commmands. If you do this, then the nesting will be created.

  7. Jan 17, 2005

    Tony McGivern says:

    Nick, I am getting a "bad parameter" error at this particular point in the macro...

    Nick,
    I am getting a "bad parameter" error at this particular point in the macro

    Private Sub WikiSaveAsHTMLAndConvertImages()
    Dim s As shape
    For Each s In ActiveDocument.Shapes
    s.ConvertToInlineShape
    Next

    I have tried removing all images, shapes and borders but cannot seem to change the behaviour, any assistance greatly appreciated

    1. Jan 18, 2005

      Nick Sieger says:

      Hey Tony, I've seen this before too and don't have a good answer as I am not a ...

      Hey Tony,

      I've seen this before too and don't have a good answer as I am not a Word/VBA expert. I would suggest you try the version of the macro that doesn't convert images, or else try commenting out that block of code.

  8. Jan 18, 2005

    Tony McGivern says:

    Ok, thanks, curious as the syntax looks right etc.. Will get one of my VB liter...

    Ok, thanks, curious as the syntax looks right etc..

    Will get one of my VB literate guys to do some digging and if we come up with anything will report back.

    Sure would be nice to have image support

  9. Feb 28, 2005

    Annie Tong says:

    Hi Niki, Thanks for the script word2wiki.bas, it eases my life to convert stuf...

    Hi Niki,

    Thanks for the script word2wiki.bas, it eases my life to convert stuff to wiki readable!

    How can I tailor the script so it'll convert MSword to a WikiWikiWeb format?

    for example for table creation, WikiWikiWeb macros look something like this,

    .xTable
    .xRow bgcolor='color'
    .xHdr
    .xCol align=`center` colspan=<# of columns>
    Something
    .xRow
    .xCol
    Something
    .
    .
    .
    .
    .xCol
    .xEnd

    Thanks in advance!

    Annie

    1. Feb 28, 2005

      Nick Sieger says:

      Try this macro: Sub WikiWikiWebConvertTables() Dim thisTable As Table ...

      Try this macro:

      Sub WikiWikiWebConvertTables()
          Dim thisTable As Table
          For Each thisTable In ActiveDocument.Tables
              With thisTable
                  Dim aLatch As Boolean
                  aLatch = False
                  For Each aRow In thisTable.Rows
                      With aRow
                          For Each aCell In aRow.Cells
                              If aCell.Range.Text = Chr(13) & Chr(7) Then
                                  aCell.Range.Text = " "
                              End If
                              aCell.Range.InsertBefore ".xCol" & Chr(13)
                          Next aCell
                          If aLatch = False Then
                              .Range.InsertBefore ".xTable" & Chr(13) & ".xRow" & Chr(13)
                              thisTable.Range.InsertAfter Chr(13) & ".xEnd" & Chr(13)
                              aLatch = True
                          Else
                              .Range.InsertBefore ".xRow" & Chr(13)
                          End if
                          .ConvertToText Chr(13)
                      End With
                  Next aRow
              End With
          Next thisTable
      End Sub
      
  10. Mar 08, 2005

    Tim Brown says:

    Here's another modification to support carriage returns inside table cells. ...

    Here's another modification to support carriage returns inside table cells.

    Private Sub WikiConvertTables()
        Dim thisTable As Table
        For Each thisTable In ActiveDocument.Tables
            With thisTable
                For Each aRow In thisTable.Rows
                    With aRow
                        For Each aCell In aRow.Cells
                            If aCell.Range.Text = Chr(13) & Chr(7) Then
                                aCell.Range.Text = " "
                            Else
                                strTemp = aCell.Range.Text
                                
                                If (Right(strTemp, 1) = Chr(7)) Then
                                    strTemp = Left(strTemp, Len(strTemp) - 1)
                                End If
                                strTemp = Replace(Left(strTemp, Len(strTemp) - 1), Chr(13), "\\")
                                aCell.Range.Text = strTemp
                            End If
        
                        Next aCell
                        .Range.InsertBefore "|"
                        .Range.InsertAfter "|"
                        .ConvertToText "|"
                
                    End With
                Next aRow
            End With
        Next thisTable
    End Sub
    
  11. May 10, 2005

    Andrea Savage says:

    Hello, being new to both Confluence and VB I followed the instructions posted h...

    Hello, being new to both Confluence and VB I followed the instructions posted herein. However, I am receiving the error abd I'm not sure what to do to correct this. So I need some help. Thanks

    Compile error:
    Expected: line number of label or statement or end of statement.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <!-- saved from url=(0087)http://confluence.atlassian.com/download/attachments/5927/Word2Wiki_Images_Word2003.bas -->
    <HTML><HEAD>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
    <META content="MSHTML 6.00.2900.2627" name=GENERATOR></HEAD>
    <BODY><PRE>Attribute VB_Name = "Word2Wiki_Images_Word2003"

  12. Jul 12, 2005

    Othman Alaoui says:

    Hi there, I have made a very small change to the macro to put a space after each...

    Hi there, I have made a very small change to the macro to put a space after each "hx." header which is more compliant with the style indicated in the Confluence Notation Guide. It wouldn't have mattered if we weren't also using the very nifty {toc} confluence macro, which unfortunately only detects headers with that space in them. It would be great if you could incorporate this change to your downloadable VB macros.

  13. Jul 22, 2005

    Steve Brown says:

    A another mod to support carriage returns properly... additions over Tim's previ...

    A another mod to support carriage returns properly... additions over Tim's previous version, is handle extra newlines, spaces, etc at the end of a cell...

    Private Sub WikiConvertTables()
        Dim thisTable As Table
        For Each thisTable In ActiveDocument.Tables
            With thisTable
                For Each aRow In thisTable.Rows
                    With aRow
                        For Each aCell In aRow.Cells
                            If aCell.Range.Text = Chr(13) & Chr(7) Then
                                aCell.Range.Text = " "
                            Else
                                strTemp = aCell.Range.Text
                                
                                Do While Right(strTemp, 1) = Chr(7) Or Right(strTemp, 1) = Chr(10) Or Right(strTemp, 1) = Chr(13) Or Right(strTemp, 1) = " " Or Right(strTemp, 1) = "\"
                                    strTemp = Left(strTemp, Len(strTemp) - 1)
                                Loop
                                
                                strTemp = Replace(strTemp, Chr(13), "\\" + Chr(13))
                                
                                aCell.Range.Text = strTemp
                            End If
        
                        Next aCell
                        .Range.InsertBefore "|"
                        .Range.InsertAfter "|"
                        .ConvertToText "|"
                
                    End With
                Next aRow
            End With
        Next thisTable
    End Sub
    
  14. Sep 01, 2005

    Gary Davis says:

    Here's another mod that can convert 'header rows' in a table. In MS-Word, "heade...

    Here's another mod that can convert 'header rows' in a table.
    In MS-Word, "header rows" have the property 'headingFormat' set to True. They don't have different formatting, but they automatically repeat at the top of following pages. To mark header rows in MS-Word, select the first row, or maybe the first two or three rows, and click on the menu items "Table / Heading Rows Repeat".

    Private Sub WikiConvertTables()
        Dim thisTable As Table
        For Each thisTable In ActiveDocument.Tables
            With thisTable
                For Each aRow In thisTable.Rows
                    With aRow
                        For Each aCell In aRow.Cells
                            ' Add a space to empty cells; 
                            ' because two vertical bars together
                            ' are interpreted as the start of a header cell
                            If aCell.Range.Text = Chr(13) & Chr(7) Then
                                aCell.Range.Text = " "
                            Else
                            ' if desired, patch here the enhancement from Steve Brown's comment above
                            End If
                            ' Convert line breaks inside tables
                            With aCell.Range.Find
                                 .ClearFormatting
                                 .Text = Chr(13)
                                 With .Replacement
                                      .ClearFormatting
                                      .Text = "\\" & Chr(13)
                                 End With
                                .Execute Replace:=wdReplaceAll
                            End With
                        Next aCell
                        If .HeadingFormat = True Then 
                           ' add two vertical bars between each header cell
                           .Range.InsertAfter "||"
                           .Range.InsertBefore "|"
                           For Each aCell In aRow.Cells
                               aCell.Range.InsertBefore "|"
                           Next aCell
                           .ConvertToText "|"
                        Else
                           .Range.InsertBefore "|"
                           .Range.InsertAfter "|"
                           .ConvertToText "|"
                        End If
                    End With
                Next aRow
            End With
        Next thisTable
    End Sub
    
  15. Nov 09, 2005

    Bob Swift says:

    Can someone who has updated their copy with all the individual additions and fix...

    Can someone who has updated their copy with all the individual additions and fixes please attach a new file to make it easier for everyone else? 

  16. Dec 19, 2005

    Mel Riffe says:

    Howdy! Love the extension and it works great...for unprotected documents.&n...

    Howdy!

    Love the extension and it works great...for unprotected documents.  So if you're trying to run the macro and it doesn't look like you can run it - it might be the document you're trying to convert is protected.

    Cheers,

    Mel

  17. Feb 16, 2006

    David Foti says:

    I am trying to install the Word converter following these directions - to the le...

    I am trying to install the Word converter following these directions - to the letter:

    Converter I am trying to use:

    • Word2Wiki 2000-2003_B.dot – Same as above with additional macro noFormatBlock which helps formatting blocks as
      
      

      Instruction I am using to install to Word 2002 SP3
      2. Start Word
      3. Bring up the Visual Basic Editor (Tools->Macro->Visual Basic Editor or Alt+F11).
      4. Make sure the "Normal" node is selected in the Project pane.
      5. From the VBE, import the macro library (File->Import File...) and select the file you downloaded.
      Note: under the 'normal' node in the project pane 'module 1' is created.

    Usage

    1. Open a word document to convert
    2. Run the Word2Wiki macro by bringing up the Macros dialog (Tools->Macro->Macros... or Alt+F8), selecting Word2Wiki and clicking Run.
    Note: The macro is not availble to select/run. Neither is 'module 1', from previous steps
    3. The macro converts the document to Confluence markup and places a copy of the content on the system clipboard.
    4. Switch to a confluence editor and paste the result.

    Any help is appreciated

  18. Feb 27, 2006

    Joel Kirchmeyer says:

    This is a really great idea, though I did encounter a problem with merged cells....

    This is a really great idea, though I did encounter a problem with merged cells.

    "Run-time error '5991': Cannot access individual rows in this collection because the table has vertically merged cells."

    Any help on this?

    1. Feb 27, 2006

      Matt Ryall (Atlassian) says:

      Sounds like it's related to one of the features above: Converts simple tables...

      Sounds like it's related to one of the features above:

      • Converts simple tables

      I'd say 'simple' excludes vertically merged cells, since this isn't supported by Confluence markup anyway.

      Does the document import successfully if you unmerge the offending cells?

      1. Feb 28, 2006

        Joel Kirchmeyer says:

        Yes it does. I guess I just thought maybe if it ran into merged cells, perhaps i...

        Yes it does. I guess I just thought maybe if it ran into merged cells, perhaps it could split them apart automatically.

      2. Aug 22, 2007

        Sean Clarke says:

        Possibly off-topic, but does anyone know how I can create horizontally merged ce...

        Possibly off-topic, but does anyone know how I can create horizontally merged cells in a simple table (either Rich Text or Wiki Markup)?  Is there a 'span' tag?  I'm not yet familiar enough to incorporate all the scripting/macros/templates described earlier in the thread.  Thanks for any help.

  19. Mar 21, 2006

    stew stryker says:

    I'm very impressed at how well this macro works!  It took a fairly comp...

    I'm very impressed at how well this macro works!  It took a fairly complex specifications document that makes heavy use of tables and did a great job converting it.  It even did a fair job on the example report layout page that was designed in landscape mode!

    I think you need to mention that folks have to download a .bas, even if they plan to use the .dot template file.  At least I seemed to have to do that, based on my initial read of the directions ("Same as above but supports both Word 2000 and Word 2003....").  I tried just opening the template file then the file to convert and nothing seemed to happen.

    But still, this macro does a great job and the developer has my heartfelt thanks!

  20. Mar 22, 2006

    Faith Dabney says:

    Need Help. I can install and run all of the .bas macros, but they don't really ...

    Need Help.

    I can install and run all of the .bas macros, but they don't really do what I need.  I need a macro that helps more with formatting issues - such as paragraph formation, odd spacing, etc, and I think the Word2Wiki 2000-2003_B.dot will work, but I can't seem to get it installed correctly.  Can someone out there give some help to this macro challenged person?

    Thanks in Advance!

  21. Mar 23, 2006

    Helmut Namyslo says:

    I hope the installation and usage description that I added above will help.

    I hope the installation and usage description that I added above will help.

    1. Mar 23, 2006

      stew stryker says:

      Helmut,  Thanks very much for adding the usage instructions.  They wo...

      Helmut,

       Thanks very much for adding the usage instructions.  They worked perfectly.

    2. Mar 23, 2006

      Faith Dabney says:

      Yes, Thank you very much.  This additional instructions were a tremendous h...

      Yes, Thank you very much.  This additional instructions were a tremendous help!  It now converts the document and I can paste it into confluence, however I'm still not getting the results I'm looking for, so maybe what I'm after isn't possible with confluence.  Maybe you can tell me . . . we have an english faculty member who wants to use it for a poetry class, but even with the converter I can't get her poem to keep it's original form (primarily paragraphing and spacing).  Any ideas?

       Thanks!

      1. Mar 28, 2006

        Tom Davies says:

        Faith, Please open a  support request at http://support.atlassian.com, and...

        Faith,

        Please open a  support request at http://support.atlassian.com, and attach one of the word documents which is giving you problems.

        Thanks,

          Tom
         

        1. Mar 30, 2006

          Faith Dabney says:

          Thanks for pointing me in the right direction!

          Thanks for pointing me in the right direction!

    3. Mar 23, 2006

      Jonathan Nolen says:

      Thanks for adding those instructions! We really appreciate it. Cheers, Jonathan

      Thanks for adding those instructions! We really appreciate it.

      Cheers,
      Jonathan

  22. Apr 11, 2006

    Yoshia Makino says:

    I've been trying to convert HTML docs to confluence the long way around using th...

    I've been trying to convert HTML docs to confluence the long way around using this macro and I came across an issue where images have to be embedded before this macro can extract images.

    I've found the following works for me where I cut/paste as described by http://support.microsoft.com/kb/825576#E0IB0ACAAA

        If ActiveDocument.InlineShapes.Count > 0 Then
            
            For i = 1 To ActiveDocument.InlineShapes.Count
                    Selection.ClearFormatting
                    ActiveDocument.InlineShapes.Item(i).Select
                    With Selection
                        .Cut
                        .PasteSpecial DataType:=wdPasteMetafilePicture, Placement:wdInLine
                    End With
            Next
        End If
    

    Related to images, <hr> tags are converted to images so I just had to revert to removing them since I don't care much about it.

     If ActiveDocument.InlineShapes.Item(i).Type = wdInlineShapeHorizontalLine Then
                    ActiveDocument.InlineShapes.Item(i).Delete
     End If
    

    I'm fairly new to this vbs thing so if there are easier ways to do this, I would love to hear comments.

    1. Jun 12, 2006

      Frank Polscheit says:

      Please find enclosed the additional procedure to be integrated into the Word-2-W...

      Please find enclosed the additional procedure to be integrated into the Word-2-Wiki Macro for converting document-internal cross references in addtion to standard hyperlinks:

      Private Sub WikiConvertCrossReferences()
          ActiveDocument.Bookmarks.ShowHidden = True
          For Each aBookmark In ActiveDocument.Bookmarks
              aBookmark.Range.InsertBefore "{anchor:" + Mid(aBookmark.Name, 2) + "}"
          Next
          
          For Each aField In ActiveDocument.Fields
              If aField.Type = wdFieldRef Then
                  Dim myText As String
                  aField.Select
                  Set myRange = ActiveDocument.Range(Start:=Selection.Start)
                  myText = "[" + aField.Result.Text + "|#" + Mid(aField.Code.Text, 8, Len(aField.Code.Text) - 7 - 3) + "]"
                  Selection.Delete
                  myRange.InsertBefore myText
              End If
          Next
          
      End Sub
      
  23. Jun 29, 2006

    Christian Hatz says:

    Hi @ all i am using the Word2Wiki+2000-2003_B.dot and i got some Problems with ...

    Hi @ all

    i am using the Word2Wiki+2000-2003_B.dot and i got some Problems with it.

    1. It doesnt work to convert empty cells in a table. It would be better if there would be placed a spacer in empty cells like a "-"

    2. The macro has a Problem with spaces in the file name.. can anybody solve this problem? I am not very experienced in makro programing. 

    3. I got to convert more than 3000 word documents (including pictures) and so we wrote a small program in vb. Unfortunately it doesn`t work very well.

    The Program creates a list of all .doc files contained in the folder (also sub-folders) then it opens the first doc file and adds the macro. The makro converts the doc file and pastes the wiki conform text into a txt file, named like the doc file. Also the pictures get`s saved in a folder, named like the doc file as well. After that, the word document will be closed and the program goes on with the next doc file.

    I got to find a way to get these documents into confluence and it really costs a lot of time. I am sure i am not the only one who needs to convert a lot of doc files to the wiki format. So please let us find a way together. I can also offer you the source code of the vb script. Just let me know. 

    Christian Hatz

    xcitan@gmx.net 

  24. Aug 27, 2006

    Michael McKeown says:

    FYI - I've added a Content Converter for Office that does everything this tem...

    FYI - I've added a Content Converter for Office that does everything this template does except no format blocks, as well as some additional items such as:

    • Inserts the page directly into your Wiki
    • Automatically attaches images to the page
    • Can convert entire trees of documents
    • Handles both Word (nested tables and inline shapes (e.g. textbox) not working properly) and Excel (no image support in excel yet)
    • Replaces Table of Contents with
      {toc}
    • Replaces some invalid non UTF8 characters
    The plugin is still in early development - e.g doesn't replace existing documents yet - only adds new ones
    1. Nov 13, 2007

      B Dhurka says:

      Is a single user license available for the MS Office Add-in? Thanks.

      Is a single user license available for the MS Office Add-in?

      Thanks.

      1. Nov 16, 2007

        Mike says:

        Yes - just email sales@hiason.com.au for pricing and payment methods.

        Yes - just email sales@hiason.com.au for pricing and payment methods.

  25. Jan 30, 2008

    Great Kindness says:

    The word2wiki.bas macro is very nice; however, I found a bug in it. Here's what ...

    The word2wiki.bas macro is very nice; however, I found a bug in it. Here's what I did:

    1. I entered the following text: "aasdfasdf asdfkajsdl;kfjk"

    2. I ran the macro

    3. I got the output: "_aasdfasdf _asdfkajsdl;kfjk"

    I expected the following output: "_aasdfasdf_ asdfkajsdl;kfjk"

    My guess is that the italics formatting in Word included the space character after the "aasdfasdf". Thus, it threw the "" in after the space. Confluence then won't recognize the closing "" character because it has a space before it. Instead, Confluence simply displays the "_" character literally. I guess the VBA macro could be modified to handle selections that end in a space. I'll bust out my antiquated VBA skills and try to fix it.

  26. Aug 05, 2008

    Jan Helge Maurtvedt says:

    Hello Chrystopher, it works fine as long as you have no formating in your codume...

    Hello Chrystopher, it works fine as long as you have no formating in your codument, but once that shows up it crashes. It seems to be this code line contains non-existing reference:

    .Style = ActiveDocument.Styles("Default Paragraph Font")
    in almost all of the functions do not work. A quick fix was to comment it out, but I would like to find the Normal.dotx's new name on the Default Paragraph Font as to make it work. Anyone?

  27. Oct 23, 2008

    Mario Servin says:

    hi everybody. The macro works almost perfectly!!. I still have an issue:...

    hi everybody. The macro works almost perfectly!!. I still have an issue: tables at my Wiki (MediaWiki powered) do not show borders. I am using the version Word2Wiki_Images_International_Word2003.bas with the following sub: (it's a modification because the original did not work at all, this version works but fail in showing the borders)

    Private Sub WikiConvertTables()
    
        Dim thisTable As Table
        For Each thisTable In ActiveDocument.Tables
            With thisTable
                For Each aRow In thisTable.Rows
                    With aRow
                    For Each aCell In aRow.Cells
                        With aCell
                            aCell.Range.InsertBefore "|"
                            'aCell.Range.InsertAfter "|"
                        End With
    
    
    
                    Next aCell
                    '.Range.InsertBefore "|"
                    .Range.InsertAfter vbCrLf + "|-"
    
                    End With
                Next aRow
            .Range.InsertBefore "{|" + vbCrLf
            .Range.InsertAfter vbCrLf + "|}"
            .ConvertToText "|"
            End With
        Next thisTable
    End Sub
    

    Can anybody help me? Thanks in advance