Re: [python-win32] Converting HTML formatting to Microsoft Word

2011-06-15 Thread sharpblade
Heh, thanks! I dreamed of writing some nice recursive function, but I gave up and moved to the HTMLParser module: http://paste.pocoo.org/show/408125/ Its WIP at the moment but works nicely with bold, underline, italics and bulletpoint lists. It was a lot nicer and more concise before I found out t

Re: [python-win32] Converting HTML formatting to Microsoft Word

2011-06-15 Thread Mark Hammond
On 14/06/2011 6:51 PM, sharpblade wrote: I whipped up this function: http://pastebin.com/kaZz5dBd which should work, but line 22 and 23 doesn't work for some reason - all text after it is bold. The last thing you do in those lines is set the range to bold - presumably later you then insert mor

Re: [python-win32] Converting HTML formatting to Microsoft Word

2011-06-14 Thread sharpblade
Ah yes, sorry I didn't specify that. It is part of an existing doc: I have a Django web application with a Report model which contains information I need to put into a word document. Most of this is simple stuff requiring no formatting, and I achieve this by defining several bookmarks within the ma

Re: [python-win32] Converting HTML formatting to Microsoft Word

2011-06-14 Thread Tim Golden
On 14/06/2011 00:20, Tom wrote: Hello, I have a Javascript rich text editor (Specifically the Yahoo UI libraries Simple Editor) which I have embedded within my web application. This produces formatted HTML from the users input which has to be placed within a Word document. The number of formattin