cancel
Showing results for 
Search instead for 
Did you mean: 

Copying File to Clipboard to paste in application

MarcusAllen
Level 4
Hello fellow developers,

I have come upon a little problem in my bot. I am working with an application that using a document manager to house files needed for client work. But the interesting thing is that to add files it only utilizes drag and drop or copying the file from File Explorer and then pasting it into the folder located in that document manager.

Worst case is having to write some visual basic to basically copy that file to the clipboard and then paste it with CTRL + V into the document manager itself but I was wondering is there some kind of business object that I am missing or a build in object that I may be overlooking to achieve this? Any thoughts would be appreciated.

Thank you,

------------------------------
Marcus Allen
Programmer Analyst II
Elliott Davis
NC
------------------------------
2 REPLIES 2

KrishnaA
Staff
Staff
Hello Marcus,

Have you explored Utility - File Management VBO.   It has actions to copy files.

Best regards,

------------------------------
Krishna A
Blue Prism
------------------------------
Krishna A [CompanyName]

Yes, I have tried the File Management VBO but that is only for moving to other directories. I needed to copy a file and then hold it in the machine clipboard to place it into another application. I actually did some C# code that works perfectly for what I need. Thank you for your reply though. Truly appreciate it.

Just make sure you have System.Windows.Forms.dll in your code section and use C# and not Visual Basic.
The code I used was basically as the following:

Make sure you have an input value for this example it is FIle.Path

StringCollection paths = new StringCollection();
paths.Add(File_Path);

Clipboard.SetFileDropList(paths);

Thank you.
------------------------------
Marcus Allen
Programmer Analyst II
Elliott Davis
NC
------------------------------