Wikiup:Archiv/Textverarbeitung/Word2MediaWikiPlus
Word2MediaWiki Plus
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
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
See a demonstration!
Features
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
- 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
Run the Demo
- Open the Demo (Word2MediaWikiPlus_Demo.doc)
- 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.
Download
- Complete macro and demo document: Download (zip-file, ~500 KB)
- Demo document only (zip-file, ~300 KB).
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
- For developers:
- Start MS-Word
- Go into the Visual Basic Editor (Alt+F11)
- Mark the Projekt Normal (NORMAL)
- Import all files (Ctrl-M)
- cDIBSection.cls
- clsCommonDialog.cls
- modEnumMetafile.bas
- Word2MediaWikiPlus.bas
- Word2MediaWikiPlusGlobal.bas
- customize the macro
- create a symbol on your symbol bar for easy access: connect to macro: Normal.Word2MediaWikiPlus.Word2MediaWikiPlus
- Alternativly:
- Start MS-Word
- Open the Demo (Word2MediaWikiPlus_Demo.doc)
- Go into the Visual Basic Editor (Alt+F11)
- Copy the files to your normal.dot project (use your mouse to drag and drop)
- customize the macro
- create a symbol on your symbol bar for easy access: connect to macro: Normal.Word2MediaWikiPlus.Word2MediaWikiPlus
Customizing (most important)
- 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
- 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.
Credits
- The first version of this converter seems from Swythan at TikiWiki
- A slightly modifierd version is Word2Wiki from InfPro IT-Solutions.
- The Word Image Extractor uses the code of Stephen Lebans.
- For the numerous api descriptions I thank The KPD-Team.
- For the picture conversions you may use the BMP2PNG-Converter of Miyasaka Masaru.
- And of course: A lot of work of me: Gunter Schmidt. Have a look at my website.
Version Info
This Version works only with Word 2000 and above.
Version 0.3 Word2MediaWikiPlus
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
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
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
(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
Code
Here you find the newest Release: Download
Some old coding in plain text: Wikipedia:Helferlein/Word2Wiki