Word - You placed a large amount of content on the clipboard...

Asked By Raph on 21-Jun-11 03:18 AM
Hi there,

I have been in struggle for quite some time with this message. I use
Office 2010 on Win 7 Enterprise.

So I use automation in Word to create some documents. I use copy paste
a lot indeed. When my procedure is finished and I want to close Word
the message "You placed a large amount of content on the clipboard. Do
you want this content to be available...etc. etc."

I have tried with a few techniques found in forums and newsgroups to
suppress this warning with. All of them do not work

Method 1 - Suppress warnings

At the beginning of the procedure I place

Application.DisplayAlerts = wdAlertsNone

At the end and where I exit in errorhandling

Application.DisplayAlerts = wdAlertsAll

Method 2 - An auto exit macro in a global template

Sub AutoExit()

On Error GoTo errorhandler

Dim myData As DataObject

Set myData = New DataObject
myData.SetText " "
myData.PutInClipboard

Application.NormalTemplate.Saved = True

Exit Sub
errorhandler:
End

End Sub

Method 3 - Empty clipboard

Private Declare Function apiOpenClipboard Lib "User32" Alias

Private Declare Function apiEmptyClipboard Lib "User32" Alias

Private Declare Function apiCloseClipboard Lib "User32" Alias

Function EmptyClipboard()

If apiOpenClipboard(0&) <> 0 Then
Call apiEmptyClipboard
Call apiCloseClipboard
End If

End Function

Is there a way around this annoying message, at all?

Thank you in advance for any suggestions.

Raph.


Raph replied to Raph on 07-Jul-11 10:18 AM
To those who might be interested, I found a workaround that does it
for me.

'Replaces the clipboard content with the last 2 characters of the
document.
With Selection
.EndKey Unit:=3DwdStory
.MoveLeft Unit:=3DwdCharacter, Count:=3D2, Extend:=3DwdExtend
.Copy
End With

Greets