For storing multiple data in Clipboard, Follow the below steps.
Steps:
- Initialize the Data Object, the type of MSForms.DataObject
- Initialize a String and an Integer.
- Set the String into Data Object using SetText() method and provide format identifier
- Put the data in ClipBoard using PutInClipboard
- Fetch the data from ClipBoard using GetFromClipboard("format identifier")
Source code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Note: For working with Windows Clipboard you need DataObject, the object in MSForms library. It provides support for text-string.
For that you must add the reference Microsoft Forms 2.0 Object Library