Tags:
create new tag
, view all tags

MsWordToTWikiMLAddOnDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on MsWordToTWikiMLAddOn contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below

Feedback on MsWordToTWikiMLAddOn

I'm no VBA expert so if you can help out please do!

-- JosMaccabiani - 09 Jul 2005

The vwware package in many Linux distributions and available from http://wvware.sourceforge.net has a componenet vwHtml that converts MS-Word documents to HTML. It is very fast. I haven't used it enough to be sure of its limits and ideosyncracies, but it is worth investigating.

-- AntonAylward - 09 Jul 2005

I agree. This is more of a temporary solution, but very simple to apply for people not familiar with programming (since wvware probably won't convert to TWikiML as of yet). I'm one of those people smile

I should probably transfer this topic over to the Plugins web...

-- JosMaccabiani - 09 Jul 2005

Perhaps what we need, and what can be more generally applied, is a HTML to TWikiML converter.

-- AntonAylward - 10 Jul 2005

Thanks Jos for sharing this useful utility with the TWikiCommunity smile

-- PeterThoeny - 10 Jul 2005

Definite thanks for sharing this macro, it will save a lot of work. I have however found a couple of the scenarios which cause Word to seemingly crash/lockup. The first occurs if formatting (bold/italics) is applied to the paragraph mark at the end of a line that is contained in a bullet-list. The second occurred when the space in between italicised words was not italicised.

I have attached a Word Document with samples of the formatting that caused the first problem and a little further discussion.

I was able to work around the problem by removing formatting on all paragraph marks before running the macro. This is a screenshot which shows a sample of the input into the Edit->Replace dialogue. Note the "Font: Bold" in the search parameters and "Font: Not Bold" in the replacement. The same should be repeated for Italics.

Search/Replace Dialogue

A small bug which doesn�t halt operations is that if a word is in bold or italics, and the trailing space is also in bold/italics, then a space will be placed before the trailing * or _ causingthe effect to be ignored when forst posted to TWiki. This last problem is only a small annoyance which is outweighed by the usefulness of this macro.

If anyone out there has the time and skills to fix the looping problems that would be great!!

Thanks again for a useful macro.

-- JohnGeorges - 04 Aug 2005

Thanks for the detailed feedback!

About the bugs: actually you fixed them yourself! smile I just recorded a macro based on your search/replace and added that code in the Word2TWiki macro. That seems to work, so I uploaded it as version 1.1

I can't replicate the italics bug yet.

-- JosMaccabiani - 04 Aug 2005

I've found a series of find&replace commands that solve the formatted spaces problem (with help from Klaus Linke in m.p.w.v.beginners: (for bold:)

insert tags
   * find: (empty) Formatted:Bold
   * repl: <b>^&</b> Formatted:NotBold

remove all 'loose' formatted spaces
   * find: <b> </b>
   * repl: (empty) Formatting:None

remove leading spaces
   * find: \<b\>( @)<  (with wildcards)
   * repl: <b>

trailing spaces
   * find: (>)( @)(\</b\>)  (with wildcards)
   * repl: </b>

add missing spaces before
   * find: (>)\<b\>  (with wildcards)
   * repl: \1 <b>

add missing spaces after
   * find: \</b\>(<)  (with wildcards)
   * repl: </b> \1

remove the inserted tags
   * find: \<b\>(*)\</b\>   (with wildcards)
   * repl: \1 (Bold) 

I haven't had time to make this into a piece of the Word2TWiki macro yet (so if anybody else feels an urge... wink )

Also, it's probably better to insert an other tag that Bold, such as <TWikiBold> </TWikiBold> or something, to prevent unwanted effects in documents about HTML or web design...

-- JosMaccabiani - 05 Aug 2005

New version (1.2) uploaded, which solves the leading/trailing spaces problem. Also the ConvertBold and ConvertItalic functions are replaced. This should solve the (non-reproducable) error causing lock-ups when "the space in between italicised words was not italicised".

-- JosMaccabiani - 06 Aug 2005

Bug: the macro fails when a table contains merged rows or columns.

-- JosMaccabiani - 06 Aug 2005

Thanks Jos!! I appreciate the help (although I probably should have thought of recording the "find/replace" macro myself!!) smile I had a look over the weekend and found that the 'formatted spaces' problem, which we couldn't reproduce, was an anomaly in the document itself.

The third word in the phrase had an 'object' style applied to it, so it was appearing as italic because of the style which was confusing the issue. I think we can write this one off as just a bizarre occurrence. smile

Thanks again for your help.

-- JohnGeorges - 08 Aug 2005

MikaelOlenfalk uploaded version 1.3 of this Add On, which improves handling of nested lists. Thanks Mikael for the update! Much appreciated!

PS: In the uploaded .bas file in Sub ConvertLists, the para variable was declared two times, so I removed the second one, tested and uploaded version 1.3.1

-- JosMaccabiani - 22 Aug 2005

Uploaded version 1.4.1, which correctly handles tables with merged cells. Please note the dependancy of MS Excel.

Any feedback by users, both problems and success stories, are highly appreciated. I'm using this with Office2003. Has anyone used this with other versions? Thnx.

-- JosMaccabiani - 19 Sep 2005

Hi, the macro works great for me. Unfortunately I've had problems with a word document containing numerations with levels like

  • First level
    • Second level
      • Third level

The Macro only generate flat lists like

  • First level
  • Second level
  • Third level

So I improved the macro by adding a loop for considering levels in numerations.

Private Sub ConvertLists()
    Dim para As Paragraph
    For Each para In ActiveDocument.ListParagraphs
        With para.Range
            If .ListFormat.ListType = wdListBullet Then
                .InsertBefore "   * "
            Else
                .InsertBefore "   1. "
            End If
            For x = 2 To .ListFormat.ListLevelNumber
                        .InsertBefore "   "
            Next x
            .ListFormat.RemoveNumbers
        End With
    Next para
End Sub

I've no experience with visual basic - maybe there are better solutions. But it works with Microsoft Office 2003 and my "special document". wink I hope, this is the right place for posting my feedback...

-- DominicMueller - 02 Jan 2006

OK, I'm a total Microsoft novice but the instructions worked easy and I got it to convert a document by commenting out the first line (which it complained about) and crossing fingers. I like what I see, it's a great gift, thanks! Now I want to try converting 50-100 documents for a trial, and if successful maybe another 1500 later.

Can this conversion process be automated somewhat, or is it always done one at a time, a dozen mouse clicks per document? Is there something else that would need to be written to enhance this tool for bulk conversions, or is there just some extra instructions required for unix admins to understand how to convert whole sites?

-- SueBlake - 17 Jan 2006

Hi Dominic! Thank you for the improvement. Please feel free to add it to the macro and upload a new version to the topic!

Hi Sue, I think it should be possible to automate the task by creating a piece of macro the opens the files, saves the results into a seperate file.

However, I'm really no expert in Visual Basic, and hacked this macro together by stealing borrowing from other sources on the internet (and the great comments from other users). Unfortunately I don't have the time to work on this right now, but I you should manage to (let someone) create this functionality it would be great if you could give that back to the community!

-- JosMaccabiani - 19 Jan 2006

This macro converts hyperlinks incorrectly. Currently it outputs text followed by URL rather than the opposite.

-- SanjayChitnis - 28 Feb 2006

I think this is a great tool - thanks to all who have contributed to this.

I am having a problem though with conversion of just a simple table in Word 2003. The VBA script breaks at the line sheet.Paste in ConvertTables(). The reason given is "Run-time error '1004': Paste method of Worksheet class failed". I have both Word2003 and Excel2003 installed. I have uploaded a test document (TableConversionBug.doc) which shows this problem - at least on my machine.

Any help would be appreciated !!!!!

-- PaulOConnor - 23 Mar 2006

Dominic, Thanks for writing the new list functionality. Can you please add it to the macro and upload it here? I don't know a lot about macros and wouldn't know where to add it. Thanks. smile

-- AmandaSmith - 28 Mar 2006

Anyone having success using this on Mac OS X?

-- ArthurClemens - 03 Apr 2006

This is a good tool, and everyone here is being shy, so I'm going to incorporate two of these suggestions and upload a new version.

  1. Dominic's "sub-bullet" hack above
  2. Comment out the first line which is just a bug.

I achieved this with some fumbling: Version 1.4.3. Disregard my "(plus small twiki upload bug workaround)" comment - there is no twiki upload bug. In fact, someone with more power could delete 1.4.3 and use 1.4.2. -PabloCaskey

-- PabloCaskey - 06 Apr 2006

Go to "manage" of the attachment, change the comment, and click on "change properties only".

-- PeterThoeny - 06 Apr 2006

Pablo, thanks for being pro-active!

I've fixed the attachemtn comment and added you to the "Plugin authors" list.

-- JosMaccabiani - 08 Apr 2006

I found a problem in which this macro hangs, while converting the hyperlinks which have no text in it. I have attached the sample word document that shows this problem. I have also attached the Word2Wiki.bas file that has solution to this problem. This new Word2Wiki.bas has also corrected the problem SanjayChitnis mentioned, in which it outputs text followed by URL rather than the opposite.

-- TouseefLiaqat - 26 May 2006

I added a SHORTDESCRIPTION to the "Add-On Info" section so that this add-on is represented properly in the AddOnPackage topic and query topics. Please feel free to take this into the next release.

-- PeterThoeny - 07 Oct 2006

Has anyone included support for embedded images?

-- MiloValenzuela - 27 Nov 2006

If no one has given support for embedded images I would be interested in expanding this VBA macro (despite my newbieness with TWiki :)). Could anyone point me the steps required? For instance,

  1. Loop through embedded images
  2. Copy them to pub folder (How do I deal with permissions?)
  3. Put the attach tags

-- MiloValenzuela - 28 Nov 2006

I have no idea how to do this. But if you manage to succeed, you'd be many people's hero. When I first made some changes to this macro, I asked around on a VBA newsgroup, and people told me that this wasn't possible (but hey - this was a few years ago). FYI I'm a total VBA n00b wink

So, PLEASE give it a go and see what you can do!

-- JosMaccabiani - 04 Dec 2006

It is better to package this add-on as MsWordToTWikiMLAddOn.zip so that the download link works properly in the AddOnPackage topic and related query topics.

-- PeterThoeny - 05 Dec 2006

I added a call to the following function before running the ConverTables code. It will convert carriage returns to
tags. Most Word users at my co. seem to use the carriage return for formatting purposes. This change made the resulting twiki format look like the original Word doc.

Private Sub ConvertNewlinesToBreaks()

    ActiveDocument.Select
'Add %BR% before newlines to preserve formatting
'   * find: \n 
'   * repl:  %BR% \n 
    With Selection.Find
        .Text = vbCr
        .Replacement.Text = " %BR% " & vbCr
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub

-- ChristianStorm - 07 Dec 2006

Jos, the problem is that I wouldn't know how to deal with permissions to access the PUB folder. I'm a newbie to TWiki. I assume not everybody can have access to the PUB folder in the TWiki installation folder. Otherwise anyone could enter and delete the attachments that are included in topics. Can any experienced TWiki user chime in? Peter? Christian?

-- MiloValenzuela - 09 Dec 2006

For the time being I developed a client application that basically checks what's on the clipboard, if it is an image then it converts it to jpeg, gives it a random name in the user's temp folder (defined by environmental variable TEMP) and puts the path to the jpeg image back to the clipboard so that the user can type ctrl + v and would get the path to the image. These are the steps my users (newbies) follow:

  1. Open my wysiwyg editor
  2. Copy whatever image I like (by right click or by ctrl + c or even screenshot (using the Print Screen key) that basically puts the image in the clipboard
  3. Run my client application (an exe file to which I created a convenient shortcut in my windows toolbar)
  4. Click on the "Add an image" button in the wysiwyg editor
  5. In the "Local File" path textbox, press ctrl + v

So it basically helps me skipping some steps like opening an image editor (like paint) paste the image there, save the image as jpeg and then browsing to the image to attach it.

If you like it I could either attach it here or send it through email.

-- MiloValenzuela - 09 Dec 2006

It looks like the mediawiki people have catched up and are now ahead of us: http://meta.wikimedia.org/wiki/Word_macros version 0.7beta. There could be some things there worth stealing, if anybody has time to investigate. The code is way too complex for me.

Milo, probably the best generic short-term solution is:

  • run a macro that will extract pictures to a certain location. The location doesn't matter, but the name of the file is important and must be unique
  • The macro should replace the image in the document with a link to the filename in the TWiki topic attachment table
  • User can zip up all files and attach them to the topic. BatchUploadPlugin can extract them again
  • Copy/paste of the converted word doc creates working images in TWiki

So this still requires some work, zipping up all the images (if there's more than one). The moment when someone will implement something that allows multiple file uploads, this hurdle will fall away.

The MediaWiki macros actually do the work of the uploading, so if it's possible to directly put something in a topic's pub folder then we might be able to use that approach too. (how? i can imagine security problems for TWiki's that are not behind a corp firewall)

-- JosMaccabiani - 13 Dec 2006

Jos,

The procedure to upload sounds cumbersome. I think the majority of the TWiki users are behind a corp firewall therefore as an initial approach maybe we could copy directly those images to the PUB folder but to access that pub folder you need credentials, etc. Is there any way trigger the twiki attach script? Maybe we could look to something like AutomaticAttachments

-- MiloValenzuela - 14 Dec 2006

I have some documents here with internal links to another section inside the document, which come out as something like [[][Link]] when converted. I found if I do Control-A (select all), then Control-Shift-F9 (break all links) inside of word, then run the macro, these links go away and no longer create weird broken references. Be nicer if they could be linked in the same way they are in the Word doc, but at least this removes some post-processing on the TWiki document in this case.

-- WalterFrancis - 02 Feb 2007

I've never used internal links in Word, but if you can record a new macro that

  • searches for the link targets and inserts an anchor (# anchor_name)
  • replaces these internal links to their TWiki equivalent
Then incorporating this into the Add on macro shouldn;t be a problem...

-- JosMaccabiani - 02 Feb 2007

Milo, AutomaticAttachments is now a built-in feature of TWiki 4 and later, so that could be the way to go. I think that would require the web_dav module in apache as well, or some ftp-ing...

The mediawiki macro does a nice job of extracting the images to a predefined local folder, however I haven't had the time yet to modify this macro for TWiki...

-- JosMaccabiani - 02 Feb 2007

Jos, I couldn't find the media wiki macro that deals with images. However I found word 2 confluence. It saves the document in "htm" format which compiles the images in a folder. Then it loops through the inline images and relinks them with the appropiate confluence syntax. It would be simple to modify, however we still need to put this images in the PUB folder before re-linking them. This is the relevant part of the code:

Private Sub WikiSaveAsHTMLAndConvertImages()
    Dim s As shape
    For Each s In ActiveDocument.Shapes
        s.ConvertToInlineShape
    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

-- MiloValenzuela - 05 Feb 2007

OK Guys, here's How it works: 1. Run Word2TWiki sub. This will convert all word syntax into twiki syntax. It will eventually do a "save as" htm format which will collect all the inline images into a nice folder. Furthermore the macro will loop through the document and place links to the images in twiki syntax. These are links to attachments.

The macro will end by opening explorer and showing you the images and putting the text content in the clipboard for which: 2. Start a new topic, edit it and goto edit -> paste (or ctrl + v) 3. Manually upload all the images. This is fairly easy if you have installed the BatchUploadPlugin for which you just need to bundle all the images into a single zip file and then upload it through attach. The plugin will "explode" them in the attachment table.

-- MiloValenzuela - 23 Feb 2007

This looks cool Milo! I just tried it, and it all seems to work as advertised... If you want, just upload it to the plugin topic and change the documentation so the improvement will be more visible!

-- JosMaccabiani - 25 Feb 2007

I have detected some limitations:

  1. Formatted pictures. For some reason, pictures that have been resized inside word are no longer recognized as pictures and therefore are not saved in the htm image folder.
  2. Pictures inside table cells. They are not kept inside a table cell. As a matter of fact, I don't even know how to locate a picture inside a Twiki Table cell.
  3. Numeric bullet lists inside Table cells. All the numbers get reset to "1"
  4. WordArt textboxes get copied, but appear randomly in the text.
  5. It won't keep right formatted images with text on the left. As a matter of fact is kind of painful trying to replicate this behavior manually.

-- MiloValenzuela - 25 Feb 2007

My ideal word 2 twiki add-on would get:

  1. User login
  2. Password
  3. Web.Topic

And would do programatically:

  1. Paste TWiki text in topic
  2. Zip and upload images

I have looked at UploadToTWikiAddOn perl script. I assume it can be run only a Linux/Unix environment. Do you think it would be possible to use VBA or VB to achieve the same result?

-- MiloValenzuela - 25 Feb 2007

I made a modification to the VB code to support using the %IMAGE{}% (ImagePlugin) syntax, which is:

%IMAGE{"image.jpg" align="center"}% %IMAGE{CLR}%

Of course, this assumes one has the ImagePlugin installed

-- CraigMeyer - 28 Feb 2007

When I run this script on a word doc, I get a script error that says " Compile Error: Syntax Error" in the VB editor window. At the same point, the script is displayed behind the error and the first word of the script, "Attribute" is highlighted. I downloaded the latest version of the script that was released 28 Feb 2007 and that is the one causing the issue. Any suggestions? Thanks!

-- TedHardy - 23 Mar 2007

When I run this macro, I get a Run Time error '1004'. Application defined or object-defined error.

The debugger highlight is on the following line: If Len(Cell.FormulaR1C1) = 0 Then Cell.FormulaR1C1 = " ". Any help?

-- AshwinMaslekar - 05 Apr 2007

TedHardy - I removed that line that was highlighted, Attribute VB_Name  "Module1". After that the script ran and I got acceptable output.

-- IanTegebo - 12 Apr 2007

I ran into the problem that TouseefLiaqat fixed, and determined that MiloValenzuela's upload lost the bug fix. So I merged it back in.

-- DougClaar - 26 Apr 2007

I made a few changes to the add-on topic: Use Interwiki links to avoid broken links once add-on is installed; escape unwanted WikiWord links. See http://twiki.org/cgi-bin/rdiff/Plugins/MsWordToTWikiMLAddOn?rev1=19;rev2=18. Please feel free to take this into the next release.

-- PeterThoeny - 16 May 2007

This Add-on is fully maintained on t.o, so you've just made the next release ;). Thanks for the corrections! wink

-- JosMaccabiani - 16 May 2007

Found Word2Wiki would not work as advertised on Windows2007.

Commented out the first line:

'Attribute VB_Name = "Module1"

Then things worked as advertised.

-- GeorgeLeCompte - 04 Jun 2007

Hi Jos!

I found and checked out your nice Word macro for a mate who likes to use Word for notes and meeting minutes. Your macro helps transferring this content to TWiki topics. Very nice feature. smile

The first thing I noticed was that underlined text is not converted to <u>underlined</u>. When examining this I saw that the macro code heavily uses copy and past code. Of course it's easy to get such code from macro recording. On the other hand changing and maintaining such code is a pain.

So I decided to add some features and to refactor a bit.

  • Added conversion for underline, bold+italic, typewriter, bold+typewriter ("Courier New" is interpreted as typewriter font).
  • Introduced generalized/parametrized methods CleanFormattingParagraphEndings, ConvertHeading, ConvertStyle (and removed copy&paste versions)
  • I did not touch the other features like table conversion and image extraction.

Also a note on the installation instructions. For me and my Word 2000, the copy&paste installation step did not work without manually changing the code. I recommend using Import file... in the Visual Basic editor. This option can be accessed in the Project > Normal > context menu or via menu under File > Import file...

For your convenience I attached my updated version Word2TWiki_1.460+.bas and a patch Word2TWiki_1.460+.bas.patch that shows what I changed.

Hope this is helpful. wink

-- AlexanderStedile - 20 Jul 2007

Hi Alexander,

by coincidence I saw your note, because I don't actively maintain the add on. If you look at the form in the MsWordToTWikiMLAddOn topic, you can see ModificationPolicy    PleaseFeelFreeToModify. So please don't hesitate to update the release version, change the doc and add your name to the authors list!

I hope this doesn't sound too harsh, it wasn't meant like that. In fact, as a user of this add on I'd like to thank you very much for the improvements. My initial version was stolen from a few sources, and that about sums up my own VBA skills. In fact, I hope you can review more of the code and improve upon it!

Cheers,

-- JosMaccabiani - 20 Jul 2007

Thanks Jos, I followed your recommendation and created version 1.470.

-- AlexanderStedile - 23 Jul 2007

I'm trying out the new version and have found that where I had hyperlinks in my Word document (shown blue and underlined),

the macro is putting in %BLUE% and <u> tags. This shouldn't be necessary. 
Also %BLACK% seems to have been put in in random places, though all the text is in black.

-- TamsinTweddell - 26 Jul 2007

Answer to Tamsin: Word distinguishes between automatic text color (which is normally black) and explicit black text color. The conversion makes this distinction, too.

-- AlexanderStedile - 31 Jul 2007

Oh, I know what's the reason for this. Of course links also have this formatting in Word. Thanks for your input.

Please use version 1.470 (without color conversion) or 1.460 (also without underlining conversion). I will look into this as soon as I find time for it.

-- AlexanderStedile - 26 Jul 2007

Fortunately I already could do the fix. Created version 1.481. Please check.

-- AlexanderStedile - 26 Jul 2007

I am getting strange and inconsistent results for BOLD. Some words show up bold and others show us as

*word *
. I am using SmartEditAddon... could that be the problem?

-- HansSchwing - 31 Jul 2007

First, if the converter formats some bold word as *word*, then this has nothing to do with SmartEditAddOn.
Could you publish an example Word file that shows this behavior when converted? This would give me the chance to look into it. Maybe there is some non-printable character after the word, that is no space character. I wonder which one it could be.

BTW: Which makro version do you use? 1.481?

-- AlexanderStedile - 31 Jul 2007

I am using version 1.481. I will attach a file called TestDoc_MSWordToTWiki.doc

-- HansSchwing - 01 Aug 2007

I have realised that my problems with %BLUE% and %BLACK% are to do with how my word doc is formatted. I have been copying and pasting from Lotus Notes to MS Word to convert to TWiki (a bit of a fiddle) and the body text ends up "Black" rather than "Automatic", hence the problem in conversion. I can sort this out myself.

On a separate note, the Usage instruction for this Add On say that Inline images are collected in folder ActiveDocumentPath\YourFileName_files. This does not seem to be working for me. Does this work for anyone else? Is it a problem with how my word doc is set up, or is this a bug? I attach an extract from my document as an example here.

-- TamsinTweddell - 02 Aug 2007

@Hans: Thanks for your example file. I figured out that there were two problems. An upper case issue and a spacing issue. I was able to fix both. smile I will uploaded it as new bug fix version 1.482.
Please notice that still cross-over formatting like
%RED%abc *def%ENDCOLOR%ghi*
can be converted from Word. This will result in incorrectly nested (TWiki and) HTML tags. Although most browsers will display it anyway.

@Tamsin: Sorry, I cannot take care for your problem. We don't use the images feature of this script. Also I don't have enough time for it.

BTW: Today I have a strange viewfile issue. When downloading the current macro version, the download always froze six lines before the end. Any ideas?

-- AlexanderStedile - 06 Aug 2007

Hi, I tried your AddOn and I discovered a problem with headings that are bold. If a heading in a Word Dokument is bold the heading in TWiki is followed by some strange *. Can you manage it that bold in headings is simply ignored because TWiki uses its own style for headings?

-- KirstinWeber - 30 Nov 2007

Has anyone tested this on Twiki 4.2? I imagine that since the add-on is really for MS Word, it would work fine, but I thought I'd check if there are any substantial differences in performance.

-- GarySprague - 07 Mar 2008

I have a .doc file. I tried converting the same onto a twiki page as mentioned in this page MsWordToTWikiMLAddOn. Steps I followed are:

* I downloaded the Word2TWiki .bas file onto my local * I imported the same on to my Normal project under VB editor and saved it. * I ran the macro after mapping it.(Tools-Macro-Macros-Word2TWiki.Word2TWiki-Run)

The conversion process started but in between i got to see the following error Run Time error 5941 Application Defined or object-defined error

The page was not converted as a twiki page... I am not sure whether the steps were right or i was missing something. Please correct me if i had gone wrong somewhere and also kindly help me in fixing the same.

Thanks...

-- JeyashriSrinivasarahavan - 01 May 2008
-- (copied here from Codev -- RafaelAlvarez - 15 Sep 2008)
-- (but it should be a support request -- SeanCMorgan - 07 Oct 2008)

If there's a normal text line followed by a monospace line, the generated TML is all on one line. I think that's a bug, because if the paragraph style changes, there should be a new line. An (ugly) workaround is to insert %BR% before every new line (as was done for text in tables):

   << Selection.Find.Execute FindText:="^p", ReplaceWith:="^p", Replace:=wdReplaceAll
   >> Selection.Find.Execute FindText:="^p", ReplaceWith:=" %BR% ^p", Replace:=wdReplaceAll
Usage tip: it crashes on MS Word tables quite often, and then leaves an orphaned Excel process running. So I convert tables to text before running the macro.

P.S. I just made a bug fix: Version 1.483 - added conversion of < to &lt;
Without that, any <text like this> in Word isn't be visible in TWiki.

-- SeanCMorgan - 07 Oct 2008

I recently had to re-install Word 2003 SP3 and add this macro again, and wanted to share some comments.

Version 1.5 of the macro does not work on this version of Word. I encountered a path error that prevented the conversion process from finishing.

1.460 seemed to work, but also gave errors until I manually added the MS Forms 2.0 component. This component was not listed by name when I tried to add a reference, but I was able to add it by browsing for fm20.dll.

I hope this helps someone else who is stuck with an old version of Word.

-- MattStar - 2010-07-26

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatbas MsWordToTML_ImagePlugin.bas r1 manage 24.3 K 2007-02-28 - 20:33 CraigMeyer Version which requires ImagePlugin
Microsoft Word filedoc TableConversionBug.doc r1 manage 24.0 K 2006-03-23 - 16:09 PaulOConnor Document which shows the sheet.Paste problem with tables in Word2003
Microsoft Word filedoc TestDoc_MSWordToTWiki.doc r1 manage 56.5 K 2007-08-01 - 04:43 HansSchwing This file when converted has problems with Bold text.
Unknown file formatbas Word2TWiki_1.460+.bas r1 manage 14.4 K 2007-07-20 - 09:45 AlexanderStedile Added conversion for underlining, combined formats. Refactored.
Unknown file formatpatch Word2TWiki_1.460+.bas.patch r1 manage 18.1 K 2007-07-20 - 09:46 AlexanderStedile Patch from 1.460 to 1.460+
Unknown file formatbas Word2Wiki.bas r3 r2 r1 manage 24.2 K 2007-04-26 - 20:56 DougClaar Merged back in TouseefLiaqat's bug fix
Microsoft Word filedoc Word2WikiBugDemo.doc r1 manage 20.5 K 2005-08-04 - 15:34 JohnGeorges Demonstration of macro loop behaviour
Microsoft Word filedoc fuses.doc r1 manage 1480.5 K 2007-08-02 - 09:29 TamsinTweddell example MS Word doc - images don't get processed
Microsoft Word filedoc hang_in_links.doc r1 manage 19.5 K 2006-05-26 - 07:06 TouseefLiaqat Document showing problem in which macro hangs while converting the links
Edit | Attach | Watch | Print version | History: r67 < r66 < r65 < r64 < r63 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r67 - 2010-07-26 - MattStar
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.