I'm not sure what you see as the difference between a picture pasted from
the clipboard as opposed to one inserted using Insert > Picture. If the
copied picture is a simple graphic, the result is the same either way.
Unless you have in mind that the pictures should be linked rather than
embedded? Or are you trying to prevent the pictures being inserted as
objects (ie with all the baggage of an embedded application)?
Whatever, intercepting the Paste command and trying to work out what the
user is doing is tricky. You could intercept EditPaste, count the number of
pictures in the document, let them paste whatever they want, then check if
the number of pictures has gone up. If so, Undo, and display your message.
Another approach would be to check the document when it is saved: "This
document has too many pictures.... please fix".
However, I would recommend against all of this. The effort of trying to
support code running on other people's computers, plus fielding their calls
when things go wrong (and believe me, you'll get blamed for *everything* ...
"my computer's been totally stuffed since Mark installed that f*g macro...")
will almost certainly be more than dealing with obese documents.
MarkN said:
Thanks for getting back to me,
I am not really VBA (or VB) literate but can 'hack' with the best of them.
I
just like to know something is possible before I start.
To answer your question, this will not help me with existing documents,
but
most of these documents are produced using a selection of templates. I was
thinking that if I added a macro to the templates that stopped the paste
command from working when an image was to be pasted and also included a
message box "paste won't work, use Insert Picture" then future problems
would
be solved.
Does that sound like it might work?