Help with Copy PDF-File to Clipboard

I’m trying to copy a file to the Windows clipboard using UiPath — just like what happens when you select a file in File Explorer and press Ctrl + C.

I don’t want to copy the contents of the file — I want to copy the file itself, so I can later paste it (Ctrl + V) into an field within an applicatoin (lotus notes).

I tried using the Copy File activity, but it only works with file system paths — it doesn’t support the clipboard as a destination.

Best regards

Hi @christoph.wozniak

Please try using Set to clipboard activity first and then Get from clipboard activity.

Also, 1 question why are trying to use clipboard in this scenario to copy files from one place to another?

have you tried using Get files and then copying fetched files to another location(without bringing clipboard in play?)

@christoph.wozniak

Welcome to community!!

Use copy file activity from UiPath and look for any option over there in lotus notes to place the file and enter that copied filepath over there, or

is it possible to share the any images with all steps share those so that will try to give exact solution

Hello @christoph.wozniak

Import System.Windows.Forms namespace then
you can try below code in Invoke Code activity

Dim d As New DataObject(DataFormats.FileDrop, file_to_copy2Clipboard)
System.Windows.Forms.Clipboard.SetDataObject(d, True)

Let us know if this works for you

update: Added source
source: StackOverFlow

Hi, is “using Get files and then copying fetched files” single activity name?

@gorby

No no. Get files is a function which can be used with assign activity. Then run loop through the list with copy file activity inside.

Directory.GetFiles(“address”)

They aren’t trying to copy files from one folder to another. They’re trying to mimic what happens when you select a file in Windows Explorer and press CTRL+C.

@gorby ignore that suggestion, it has nothing to do with what you’re trying to achieve.

This is what you should be doing.