I fail to copy files programmatically to the clipboard using c# in Ranorex. The code does work perfectly in Visual Studio but whenever I use it within a Ranorex Code-Module the clipboard stays empty.
The code:
public static void FillClipboard(List<string> paths)
{
if (paths.Count > 0)
{
System.Collections.Specialized.StringCollection col = new System.Collections.Specialized.StringCollection();
foreach (string s in paths)
col.Add(s);
System.Windows.Forms.DataObject data = new System.Windows.Forms.DataObject();
data.SetFileDropList(col);
Clipboard.SetDataObject(data);
}
}Can you please help me with that?
Regards,
Surs