vba-クリップボード操作

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


投稿日

カテゴリー:

投稿者:

タグ:

コメント

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です