با استفاده از اين كد شما ميتوانيد يك عكس يا فايل متني را در كليپ بورد ذخيره نماييد يا اينكه تصوير يا متن ذخيره شده در كليپ بورد را در يك فايل ذخيره كنيد.
کد:
Public Function Load_Image_To_Clipboard(file As String)
Clipboard.SetData LoadPicture(file)
End Function
Public Function Save_Image_From_Clipboard(file As String)
SavePicture Clipboard.GetData, file
End Function
Public Function send_Text_File_To_Clipboard(file As String)
On Error GoTo error
Open file For Input As #1
Clipboard.SetText Input(LOF(1), 1)
Close #1
Exit Function
error:
y = MsgBox("File Not Found", vbOKOnly, "Error")
End Function
Public Function recive_Text_From_Clipboard_to(file As String)
On Error GoTo error
Open file For Output As #1
a$ = Clipboard.GetText
Print #1, a$
Close 1
Exit Function
error:
x = MsgBox("There has been a error!", vbOKOnly, "Error")
End Function