查看: 27  |  回复: 0
  VBA代码 清空剪贴板
楼主
发表于 2025年3月18日 15:33
#If VBA7 And Win64 Then
     Declare PtrSafe Function OpenClipboard Lib "user32" (ByVal hwnd As Integer) As Integer
     Declare PtrSafe Function EmptyClipboard Lib "user32" () As Integer
     Declare PtrSafe Function CloseClipboard Lib "user32" () As Integer
#Else
     Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Integer) As Integer
     Declare Function EmptyClipboard Lib "user32" () As Integer
     Declare Function CloseClipboard Lib "user32" () As Integer
#End If

Sub clearClipboard() '清空剪贴板
    Dim p As Integer
    OpenClipboard (p)
    EmptyClipboard
    CloseClipboard
End Sub


您需要登录后才可以回帖 登录 | 立即注册
【本版规则】请勿发表违反国家法律的内容,否则会被冻结账号和删贴。
用户名: 立即注册
密码:
2020-2025 MaNongKu.com