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

R

Raph

Hi there,

I've 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 don't 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
"OpenClipboard" (ByVal hWnd As Long) As Long

Private Declare Function apiEmptyClipboard Lib "User32" Alias
"EmptyClipboard" () As Long

Private Declare Function apiCloseClipboard Lib "User32" Alias
"CloseClipboard" () As Long

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.
 
R

Raph

Hi there,

I've 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 don't 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
"OpenClipboard" (ByVal hWnd As Long) As Long

Private Declare Function apiEmptyClipboard Lib "User32" Alias
"EmptyClipboard" () As Long

Private Declare Function apiCloseClipboard Lib "User32" Alias
"CloseClipboard" () As Long

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.

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:=wdStory
.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
.Copy
End With

Greets
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top