Word to Textile conversion

If you have Microsoft Word, you can use a macro to convert formatted text in Word into Textile format using the Word2Textile macro.

The macro will convert most common formatting, including:

  • Replaces curly quotes with straight quotes (which then get re-converted by Textile)
  • Converts external hyperlinks
  • Converts h1-h5 headings
  • Converts bold/italic/underline/strikethrough/superscript/subscript formatting
  • Converts bulleted/numbered lists
  • Converts simple tables.

Some things it can’t handle:

  • Tabs
  • Color
  • Leading or trailing formatted spaces
    If anyone knows how to fix these problems, please let me know.

I find this especially useful for converting text copied from Web pages. Paste into Word, run the macro (I have it hooked to a keyboard shortcut), then paste the result into a Wiki page (including Adventure Logs, Characters, Items and Forum posts) on Obsidian Portal. Most of the formatting—including links!—is preserved intact.

Installation instructions are below. If you have any difficulties with this, feel free to let me know, though note that I am anything but an expert on Word macros; I just modified an existing example to make it work for Textile.

Installation instructions for PC

Installation

  1. Download the Word2Textile macro library.
  2. Start Word.
  3. Bring up the Visual Basic Editor (Tools→Macro→Visual Basic Editor or Alt+F11).
  4. From the VBE, import the macro library (File→Import File…) and select the file you downloaded.
  5. Rename the resulting macro to “Word2Textile” (I’m not entirely sure how you do this step, as I don’t have Word for PC).

Usage

  1. Open a word document to convert.
  2. Run the Word2Textile macro by bringing up the Macros dialog (Tools→Macro→Macros… or Alt+F8), selecting Word2Textile and clicking Run.
  3. The macro converts the document to Textile markup and places a copy of the content on the system clipboard.
  4. Switch to a Textile editor (such as an Obsidian Portal wiki page) and paste the result.

Installation instructions for Mac

Installation

  1. Copy the provided macro code into the clipboard.
  2. Run Word, and go to Tools→Macro→Macros…. You will get a dialog box that lists all existing macros, if you have any. In the box for Macro Name, type Word2Textile. Click Create.
  3. After clicking Create, Word will dump you into the Visual Basic Editor (VBE, the environment where one can write and edit macros written in VBA). It may look very strange to you. Basically, it’s a three-pane layout, and the code you are about to work on should be in the right-hand (largest) pane.
  4. You will see something like:
    Sub MyMacroName()

    ’ MyMacroName Macro
    ’ Macro created 03/08/05 by Me

    [cursor will be here]
    End Sub
  5. Delete all of the code shown above.
  6. Paste in the macro code that you copied earlier.

Usage

  1. Open a word document to convert
  2. Run the Word2Textile macro by bringing up the Macros dialog (Tools→Macro→Macros…), selecting Word2Textile and clicking Run.
  3. The macro converts the document to Textile markup and places a copy of the content on the system clipboard.
  4. Switch to a Textile editor (such as an Obsidian Portal wiki page) and paste the result.

Apparently macros only work with versions of Word for Mac prior to Word 2008.

Word to Textile conversion

SyDarkSun Calion Calion