2

This code-snippet (from VB6) starts an Word 2003 application and adds a new document:

Dim WithEvents wApp As Word.Application
Dim WithEvents wDoc As Document

Set wApp = New Application

wApp.DisplayAlerts = wdAlertsNone

Set wDoc = wApp.Documents.Add
wApp.Visible = True

Scenario:

  1. I run something like this code from a simple vb6 application.
  2. I Copy a large text (ie. from a website) and paste it into the new word document
  3. After pasted the text a couple of times into same document, I mark it all, and copy it from Word
  4. Then I close the word application, refuse to save the document and get the ".... large amount of data..." warning at the end.

Allmost every example I found, describes this warning-problem in MS-Excel and MS-Access cases, so I haven't found any working MS Word solutions. And yes, I have tried to change or even remove the registry value

HKey_CURRENT_USER\Software\Microsoft\Office\11.0\Common\General\AcbControl

Without having any effect to the warning-problem in MS-Word 2003.

I have to get the last copied data after closing the word-application, so clearing the clipboard is not a solution.

Has MS Word 2003 a bug ignoring any warning settings, or is there any way to disable the "you copied a large amount of data onto the clipboard..." warning when closing Word 2003. In settings or from some code ?

user759792
  • 61
  • 7
  • Presumably you want to copy formatting & not just the text? – Alex K. Jun 20 '12 at 16:44
  • Excactly! Next step is to find the right clipboard-format. Using the api-function, CountClipboardFormats I have 17 formats, but right now the only accepted is 1-3. 1 returns text only; 3 returns the clipboard as an image (pretty good, actually) and 2 returns nothing I can see. – user759792 Jun 21 '12 at 13:03

2 Answers2

1

This warning message I believe only comes up when there is a large amount of data in the clipboard.

So if you use code to clear the clipboard, I believe the warning message will no longer show.

As you say you need the value maintained in the clipboard so temporarily store it in a variable and once you have closed the word document then reassign the saved valuable back to the clipboard.

Note there is a Clipboard object in Visual Basic 6.

For documentation on how to use the Visual Basic 6 clipboard object please click here

Mark3308
  • 1,298
  • 11
  • 22
0

The data for some of the clipboard formats Word offers only gets provided when explicitly requested. Word is warning these need to be lost or produced when it is closed. I don't know if it is able to be disabled.

Mark Hurd
  • 10,665
  • 10
  • 68
  • 101