代码如下,如果想判断为其它格式的,请自行修改。 Option Explicit Sub EditPasteSpecial() '''当用户单击选择性粘贴命令时,Word自动调用本过程 Dim myDlg As Word.Dialog Dim strDataType As String Set myDlg = Word.Dialogs(wdDialogEditPasteSpecial) '''选择性粘贴对话框 If myDlg.Show = -1 Then strDataType = UCase$(myDlg.DataType) '''获取数据类型 End If Set myDlg = Nothing If strDataType = "TEXT" Then '''无格式文本 MsgBox "无格式文本方式已被选中!", vbInformation, "Rousoft Office" End If End Sub |
|