PasteSpecial

K

Kate Moncrieff

Hi,

I asked this yesterday but perhaps didn't put my question
very clearly. I have a macro with the following statement:

Selection.PasteSpecial Placement:=wdInLine,
DataType:=wdPasteMetafilePicture

I only want this statement to be executed if the clipboard
contains a metafile which can be pasted in this way (i.e.,
I only want the statement to run if it CAN run).

Can anyone tell me how I can test for this? I've tried
using the GetFormat method but I've no idea which format
to look for.

I'm quite new to visual basic so please excuse me if I'm
missing something obvious.

Thanks for any tips!
Kate

PS Is this the correct newsgroup for this sort of question?
 
J

JGM

Hi Kate,

Why not just trap the potential error:

_________________________________________
Sub PasteMetaFile ()

On Error GoTo CantPaste
Selection.PasteSpecial Placement:=wdInLine, _
DataType:=wdPasteMetafilePicture

CantPaste:

End Sub
_________________________________________

HTH
Cheers!
 
Top