I have a simple macro that pastes unformatted text:
Selection.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _
wdInLine, DisplayAsIcon:=False
But if the clipboard is empty or contains something other than text (e.g., a picture), I get a run-time error telling me the specified data type is unavailable.
I’d like to wrap the macro in a simple if…then statement that first checks for the correct data type and then either runs the rest of the code or just beeps if it can’t. I don’t need it to tell my why it can’t run (i.e., I don’t want to click away an alert) or anything — even doing nothing would suffice.
Is there a simple way of doing this?
Thanks,
Rhythm