Spurious ‘OLE_LINK’ bookmarks in Word: Triggered by pasting as unformatted text

Posted by Pierre Igot in: Microsoft
June 15th, 2009 • 5:09 pm

The last time I wrote about this long-standing bug in Microsoft Word for Mac OS X, I simply mentioned that it was still there in Word 2008, just like it was in Word 2004, and in Word X before it. (My blog does not go that far back!)

I am pretty sure that one of the reasons why Microsoft’s engineers (if you can call them that) have failed to fix the problem after that many years is that they haven’t put much effort into trying to reproduce the problem.

Well, if any MacBU employee cares, I guess I should report something that I have noticed consistently over the past few months. In Word 2008 at least, I able to reproduce the problem each and every time I copy something in a Word document and then use my AppleScript script to paste the contents of the clipboard as unformatted text elsewhere in the document.

The script I use for this is the one suggested by Joe Kissell in the comments on my blog post about pasting as unformatted text in Word 2008, i.e.:

tell application "/Applications/Microsoft Office 2008/Microsoft Word.app"
	tell selection
			set theClip to Unicode text of (the clipboard as record)
			type text text theClip
		end try
	end tell
end tell

The script works fine (although there is often an annoying delay before it kicks in, due to the general slowness of Word 2008), but each and every time I use it to copy and paste without formatting something in a Word document, at the same time I paste the text, Word 2008 adds an “OLE_LINK” bookmark to the original chunk of text that I just copied.

This does not occur when I use the “Paste Special…” command in the “Edit” menu and then choose the “Unformatted Text” option, which is obviously a much more cumbersome process. It only occurs when I use my AppleScript script, to which I have assigned the command-option-shift-V shortcut.

But still… it occurs each and every time. This is now officially a 100% reproducible bug as far as I am concerned.

Of course, Microsoft’s engineers, since they are (or believe themselves to be) software developers and not actual users, probably don’t realize how important it is, in the real world, to be able to paste unformatted text as opposed to text with its original formatting, which is why the command is so difficult to access in the standard Word 2008 interface (if you can call it that) to begin with and why any serious Word user would want to create a script and a shortcut for it.

And Microsoft’s engineers probably also don’t ever bother to make bookmarks visible in their Word documents, which is another condition required to actually notice the bug, since it works invisibly behind the scenes.

In an ideal world, Microsoft would have a proper bug reporting mechanism and not just some kind of crappy generic feedback page. And in an ideal world, Microsoft would actually read this feedback and take it into account.

In that ideal world, I would actually bother to submit the bug as a bug report to Microsoft. But in the real world I will not, for the very reasons that I have mentioned several times over the years and that are summarized in my “About” page.

If there actually is a Microsoft employee out there who cares, well, he or she will have to make the effort to read this blog and reproduce the bug themselves and then do something about it—you know, just like that Firefox developer who spontaneously contacted me this morning after reading my blog post about the full-page zoom feature in Safari 4 and Firefox 3 to let me know that he had filed and fixed the alignment bug in Firefox 3 that I had incidentally described in my post and illustrated with a screen shot.

Now that’s what I call a developer. (It won’t convert me into a Firefox user, because there are a number of such flaws in the software and I still don’t find the browser Mac-like enough, but it is still impressive that the developer noticed my blog post so quickly and did something about it right away.)

I should also mention that, a few months ago, a Betalogue reader, Rob Gilpatric, wrote me an e-mail to describe a VBA script that can be used for removing the spurious bookmarks:

Sub NoMoreOLEBookmarks()
' Word for Mac has this annoying habit (in some documents, but not all) of creating a bookmark each time you cut and paste text. _
' After a while, you can accumulate hundreds of these bookmarks. _
' This macro automatically cycles through every bookmark and deletes it if its name begins with OLE_LINK.

Dim bkmk As Bookmark
Dim n As Integer

For Each bkmk In ActiveDocument.Bookmarks
If Left(bkmk.Name, 8) = "OLE_LINK" Then
n = n + 1
End If
Next bkmk

If n > 0 Then
MsgBox n & " bookmarks removed!" & vbCr & vbCr & _
"(Brought to you, courtesy Rob Gilpatric)", vbOKOnly + vbInformation, "No more OLE Bookmarks"
End If

End Sub

Of course, the script cannot be used in Word 2008, since it no longer supports VBA. And I don’t think I am going to try to “translate” this script into an AppleScript script. I don’t really have the time, and it doesn’t really fix the problem anyway. It just gives you a somewhat quicker way (than the manual way) to remove the bookmarks when you have finished working on your document. But you still have to remember to use it each and every time…

Comments are closed.