Function fromClipBoard()
Dim buf As String, buf2 As String, CB As New DataObject
With CB
.GetFromClipboard
On Error Resume Next
fromClipBoard = .GetText
End With
End Function
Function toClipBoard(str)
Dim buf As String, buf2 As String, CB As New DataObject
With CB
.SetText str ”変数のデータをDataObjectに格納する
.PutInClipboard ”DataObjectのデータをクリップボードに格納する
End With
End Function
Sub test()
Dim str
str = "test"
toClipBoard (str)
End Sub
コメントを残す