June 16, 2008 Archives

Mon Jun 16 23:49:42 UTC 2008

MS Word fails basic MS Excel integration

Yeah, I know I like finding fault with MS … but I have to work with their tools, too.

I have an Excel spreadsheet, with some currency values formatted as “Accounting”, which provides nice alignment of the currency symbol and decimal point.

When these cells are cut/paste'd into Word, the presentation of these cells is “preserved” by simulating the alignment with multiple spaces … but actually these cause the presentation to break, and the cell contents split onto multiple lines, and no longer align.

So, the hack would be to replace all those extra spaces, wouldn't it? Except MS Word doesn't have greedy matching! You can't replace, say, 8 spaces with a pattern of <space><star> … or even <space><at> (which is the “one or more” operator). You have to manually repeatedly do replace-all for decreasing explicit numbers of spaces; e.g. repeat “replace-all <space>{8} with <space>” until there are no matches, then repeat “replace-all <space>{4} with <space>” until there are no matches, then {2} …


Posted by Jim Cheetham | Permanent Link