SgDotNet
Singapore Professional .NET User Group -For Cool Developers

Deal with Two Common Problems of Using Word

(1) The first is related to copying and pasting text from the browser (eg IE).

Whenever I try to copy information from inside the browser to Word, the firewall will be triggered and ask if I want to access the site, no matter if being a single word, a single line or a complete table. Regardless of allowing or denying such an access, the delay could prolong and is very very interrupting.

I only find a workaround if the intended pasting is plain text, you can go to "Edit\Paste Special..." and in the next popup dialog choose "Unformatted Text" or "Unformatted Unicode Text", Word will then choose not to visit the site. However, I did not manage find a way to speed up this two-step process using a keyboard shortcut or alike.

I have created a small add-in that hosts a new toolbar, on which you can find a "Paste as Plain Text" button so that now one click will do the job. You may download the add-in here. To install, copy it to the template startup folder of Microsoft Word. You may find the path from "Tools\Options\ File Locations". Click on "Modify..." to see the full path. Next time you start Word, a new toolbar would be shown.

If you do not want the toolbar occupying your precious screen estate in Word, hide it and assign a keyboard shortcut to the corresponding macro. Go to "Customize...", click "Keyboard...", select "Macro" from "Categories", Select "PastAsPlainText" from "Macros" to the right, assign a key combinations to it, for example, Ctrl-Shift-V.

The code for the macro is extremely simple, there is only one important line:

Application.Selection.PasteSpecial DataType:=wdPasteText


(2) The second is that copying formatted content from Word into HTML editor or saving it as HTML files, many Microsoft-specific tags are taken along together with necessary HTML markups. They are embeeded for the sake of supporting "round trips" if you ever need to re-open HTML in Word again - though this is not happening most of the time.

In Word XP/2003, you can choose "Web Page, Filtered" in "Save As..." to produce a less bloated HTML file.

For Word 2000, you can install Office 2000 HTML Filter 2.0 from here to remove Office-specific markup tags embedded. To export as lean HTML, go to "File\Export To" and clikc "Compact HTML". You can also copy any fragment of a Word document as HTML and paste it into an HTML or text editor as filtered (ie compact) HTML markup. Use "Edit\Copy as HTML" instead of "Edit\Copy" to create a compact HTML copy.


Take a look at what Office-specific markups have been removed with this filter.

Using Office HTML Filter to remove Office-specific markup
http://office.microsoft.com/en-us/assistance/HA010549981033.aspx


Using Office HTML Filter at the command prompt
http://office.microsoft.com/en-us/assistance/HA010552491033.aspx

If it can be used at the command prompt, it should be used with other Office versions and the command prompt could be handy when dealing with batch files.

Posted Oct 24 2004, 06:04 PM by blackinkbottle
Filed under:
Copyright SgDotNet 2004-2008
Powered by Community Server (Commercial Edition), by Telligent Systems