Wikipedia:Archiv/Textverarbeitung/Word2MediaWikiPlus

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen

Diese Seite gehört zum Wikipedia-Archiv.

Word2MediaWiki Plus

[Quelltext bearbeiten]

Dieser Konverter wandelt Word-Dokumente so um, dass sie in ein MediaWiki kopiert werden können und in etwa gleich aussehen. Hierbei wird die Textformatierung übernommen, Tabellen und Listen umgewandelt und eingebundene Bilder können in verschiedene Formate (jpg, png, gif, bmp) umgewandelt werden und auch automatisiert in das Wiki hochgeladen werden. Details siehe unten.
Es handelt sich um Makros, die in Microsoft Word eingebunden werden müssen.

Ergänzungen und Kommentare bitte auf der Diskussionsseite.
Anregungen und Beispiele, die sich nicht gut konvertieren lassen, bitte an meine Mailadresse: Word2MediaWikiPlus@beadsoft.de

Alle folgenden Informationen sind auf englisch.

Info in English

[Quelltext bearbeiten]

This Word Visual Basic macro converts Microsoft Word document content to MediaWiki markup.
Usage requires a running copy of Microsoft Word that supports Visual Basic macros (Word 2000 or greater).

Ideas and bug reports please on the discussion page.

Example files of not so good working documents: please send to my eMail: Word2MediaWikiPlus@beadsoft.de

Word2MediaWikiPlus: Download code here.

Demonstration

[Quelltext bearbeiten]

See a demonstration!

converts:

  • Text
    • bold/italic/underline/strikethrough/superscript/subscript formatting
    • text colors
    • text size
    • Replaces smart quotes/double-quotes with dumb equivalents
    • Escapes the following characters: * # { } [ ] ~ ^^ | '
  • H1-H5 Headings
  • Page header and footer (optional)
  • Tables (complex)
    • with alignment
    • with merged cells
    • with background colors
    • adds blank space to empty cells so the table looks nicer
    • converts nested tables
  • Hyperlinks
    • http and ftp
    • mailto:
    • local file
  • Lists (simple bulleted/numbered lists)


additional:

  • Image extractor, converter and uploader to your wiki
  • some other enhancements and bugfixes
  • works with international versions of word (german), too
  • can be localized and customized

Tested Environment

[Quelltext bearbeiten]
  • MS-Word 2000 and 2002, German
  • MediaWiki 1.5.3 and 1.6.5 German
  • Microsoft Photo Editor German
  • Windows XP (without admin rights)
  • The macro has numerous CONST which need to be customized to your language and MediaWiki. You will find information in the inline documentation of the macro.

Installation

[Quelltext bearbeiten]

Run the Demo

[Quelltext bearbeiten]
  1. Open the Demo (Word2MediaWikiPlus_Demo.doc)
  2. Start the Macro (you should see a button in your symbol bar, calles Word2MediaWikiPlus Converter)
    • Do not worry about customizing yet
    • If you want to check the picture function and the upload, you will need to customize the macro
    • You need to work with the visual basic editor (Alt+F11) and change some CONST variables. No need to write coding.

These zip-files can be unzipped by Windows XP or almost any packer software.
If you need a program to unrar (not for these zip-archives!), use this freeware: DF unRar (no installation, no admin rights needed)

Code installation

[Quelltext bearbeiten]
  1. For developers:
    1. Start MS-Word
    2. Go into the Visual Basic Editor (Alt+F11)
    3. Mark the Projekt Normal (NORMAL)
    4. Import all files (Ctrl-M)
      • cDIBSection.cls
      • clsCommonDialog.cls
      • modEnumMetafile.bas
      • Word2MediaWikiPlus.bas
      • Word2MediaWikiPlusGlobal.bas
    5. customize the macro
    6. create a symbol on your symbol bar for easy access: connect to macro: Normal.Word2MediaWikiPlus.Word2MediaWikiPlus
  2. Alternativly:
    1. Start MS-Word
    2. Open the Demo (Word2MediaWikiPlus_Demo.doc)
    3. Go into the Visual Basic Editor (Alt+F11)
    4. Copy the files to your normal.dot project (use your mouse to drag and drop)
    5. customize the macro
    6. create a symbol on your symbol bar for easy access: connect to macro: Normal.Word2MediaWikiPlus.Word2MediaWikiPlus

Customizing (most important)

[Quelltext bearbeiten]
Const isCustomized = False
True: Shuts off info about not having customized
Const DefaultStyleName$ = "Standard"
german word, Standard-Formatvorlage
Const DefaultStyleName$ = "Default Paragraph Font" 'english word
Const WikiSearchTitle$ = "Suchergebnisse"
german 'needed to open wiki-page after converting
Const WikiSearchTitle$ = "Search" 'english 'needed to open wiki-page after converting
Const WikiAddressRoot$ = "http://localhost/wiki/"
Your Wiki: The URL before the Articl-name, must have trailing /
Const ImageConvertAuto As Boolean = True
if false, the image conversion and upload routine is disabled. Problematic routine because of SendKeys-usage, details see in MediaWikiConvertImages
Const ImageUploadAuto As Boolean = True
if false, the Upload function is disabled

ToDo - or what does not work

[Quelltext bearbeiten]
  • smooth installation routine
  • lists: lists which have blank lines in between
  • lists: lists with blank spaces inbetween
  • footnotes
  • maybe a litte fine tuning of merged cells
  • I would need some free converter programs from BMP to JPG, PNG and GIF, which support command line options.
  • Some feedback and customizing on english environment would be nice, so if you use Word in english, write me your settings.

Version Info

[Quelltext bearbeiten]

This Version works only with Word 2000 and above.

Version 0.3 Word2MediaWikiPlus

[Quelltext bearbeiten]

Released May 26, 2006.

Changes:

  • general: added some const to customize this
  • general: added hourglass and statustext
  • text: added text color
  • tables: added blank space in empty cells
  • tables: added alignment of text
  • tables: added tableformat string, const TableTemplate
  • hyperlinks: redesign: changed html and file-links, others will not be converted
  • images: added function to save all pictures of the document as .bmp and replace with Image-Tag
  • paragraph spacing: added manual line break and MediaWiki-like paragraphs
  • cleanup-function

Version 0.4 Word2MediaWikiPlus

[Quelltext bearbeiten]

Changes:

  • images: added function to convert all images into .jpg or .png with Microsoft Photo Editor
  • images: added function to automaticall upload to your wiki
  • tables: tables with background colors
  • tables: tables with line breaks
  • tables: tables with merged cells
  • text: fixed bug with combined formats
  • text: added simple fontsize
  • text: added simple indention of paragraphs
  • general: wiki page display: When the macro is finished it will search for the document title in your wiki.
  • general: reorganised code
  • general: removed hourglass
  • general: styles localized
  • general: Word97 disabled with message

Version 0.5 Word2MediaWikiPlus

[Quelltext bearbeiten]

Released: June 04, 2006

Changes:

  • BugFix: Macro crashed if Icon returned error
  • BugFix: FontSize could go into endless loop
  • BugFix: Escape characters did not work correctly, if document contained "*"
  • BugFix: some tables did not merge correctly
  • BugFix: superscript and subscript
  • BugFix: text colors in tables
  • BugFix: some bugs with combined format like colored and bold
  • BugFix: exclude hyperlinks that have targets within the document
  • Changed Upload function, customizing the keystrokes, use CheckWikiUpload to test
  • Changed Picture Export to Paste with MS Photo Editor (works a lot better)
  • Feature: Nested tables
  • Feature: CheckWikiUpload test
  • Feature: ImagePasteInEditor which works better (now we might go with Word97 again (but color problem remains)
  • Feature: "manual tables" conversion, converts tables that are made with tab stops
  • Feature: PageHeader and PageFooter (optional)
  • Feature: delete hidden text (optional)
  • Feature: Macro can be started from a special macro document (Name must include the term Word2MediaWikiPlus; must not include the term Demo)
  • no need for Default Paragraph Style anymore
  • localization for en and de, other languages can be added
  • code reorganisation and optimization
  • some minor changes and bugfixes

Version 0.6 Word2MediaWikiPlus

[Quelltext bearbeiten]

(not yet released)

Changes:

  • BugFix: Formatting in tables, needed a workaround for a word bug
  • BugFix: Merged Cells did not work all the times
  • Changed Const for categories
  • Added PreFix for Imagefiles
  • Dialog for Article name and categories
  • Installation routine with few Const values
  • stores user settings in registry

Here you find the newest Release: Download

Some old coding in plain text: Wikipedia:Helferlein/Word2Wiki