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