Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing the office clipboard

Status
Not open for further replies.

ycim

Programmer
Feb 9, 2005
95
0
0
CA
I am running a program whereby I do a lot of copy > paste functions from Access. When the office clipboard gets full, the user gets an error.

I saw some discussion on this thread.


But I am wondering if anyone is able to contribute any solutions or workarounds they may have encountered.

Thanks for your help.
 
I don't know if there's something special in Access but I wouldn't normally expect a full Office clipboard to cause any problem. What error does the user get?


Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
CBasicAsslember...the API call only clears the windows clipboard. It does not clear the office clipboard.

tony...
The error that I am getting is as follows:

Word has insufficient memory. You will not be able to undo this action once it is completed. Do you want to continue?

The problem lies here...I am accessing word through Access to break down some documents. Word is hidden in the background. So, when the error pops up, all the user hears is a "beep" but they cannot see the message. The access application also locks up.



So, I need to find an appropriate workaround. I am just not sure what angle to take for it.

Thanks
 
I have just been reading the other thread so now I understand the background and, if the office clipboard is the problem, you may need an innovative solution.

CBA - What API?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
I do agree with the innovative solution part <grin>. I am just not sure what that might be....

I think the API call he is talking about is here
Code:
Declare Function CloseClipboard Lib "user32" () As Long
Declare Function EmptyClipboard Lib "user32" () As Long
Declare Function OpenClipboard Lib "user32" (ByVal hWnd As Long) As Long

'this sub empties the API Clipboard
Sub ClearAllClipboard()
    OpenClipboard 0&
    EmptyClipboard
    CloseClipboard
End Sub
 
As you've found out, that API is for the Windows Clipboard.

It seems we have been overlapping in our posts. If memory for Undo is the problem you can clear the Undo buffer - it's certainly worth trying.


Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
That is a great suggestion...

Umm...how would one do that?

By the way, I did some searching on the web for any type of solution. It would seem that this frustrates more than just myself. There is an interesting post from someone who obviously has a workaround, but the code is a bit over my head. If anyone wants to "have a go" on how to use it, it may be a worthwhile read.


In the meantime, how does one clear the undo buffer?

Thank you
 
Have you tried to not display the warnings ?
yourWordAppObject.DisplayAlerts = False

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I don't have access to a recent version of Word till tonight but, if I remember, it is (document_ref).UndoClear.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

Professional Office Developers Association
 
Wonderful suggestions..thanks...I will try them and let you know...stay tuned!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top