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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Abandoning clipboard when exiting Word

Status
Not open for further replies.

punchme

Programmer
Dec 16, 2003
14
US
I have a VBScript that does some operations in Word, and due to the size of the document I'm manipulating, when my script finally forces an exit from Word (via "objWord.Documents.Close" followed by "objWord.Quit"), I am given the prompt "You placed a large amount of text on the Clipboard. Do you want this text to be available to other applications after you quit Word?"

Is there a way to force it to not send this prompt, or to pound through it? I've already set "objWord.DisplayAlerts = False", but the prompt still comes up. I also checked the docs for Word's .Quit method, and none of the arguments say anything about telling Word whether or not to abandon the clipboard.
 
Public Sub Clear()
VB.Clipboard.Clear
End Sub


I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Sorry, that was Visual Basic.

You can find a number of examples of clearing the clipboard by doing a search on msdn.microsoft.com. Search the words Clipboard.Clear.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Thanks guys. What I ended up doing was using VBScript to highlight a very small Selection (just one line of text) and then doing a .Copy to bring that into the paste buffer. Since that small piece of text replaced the massive amount of data that was previously in the paste buffer, I no longer get the warning when I close Word.

--
Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top