How to copy notepad text to clipboard

Hi all,
I need help from friends here. I have a txt file using the argument to save this file. how to copy the content in this file and set to clipboard as to use it to paste somewhere else. Thank you.

hi @Perri,

  1. Read the Content of the Textfile using read Text Activity - This will return you an string say strText

  2. Take a Set to clipboad activity and pass strText to sep the clipboard.Below is the link
    https://docs.uipath.com/activities/docs/set-to-clipboard

3.Once You have the Data in the Clipboard - you can send Hotkey Ctrl + V in any application to paste the Data.


Mukesh

I have tried below but it having an error. Any mistakes?
sr–> is the argument that I use to save my filename. e.g. c:\temp\sr-0001.txt
output -> is a variable

Capture

Thank you for your help. problem still exist.

Check this here i’m copying text from notepad, setting out string to clipboard and pasting it to excel. @Perri

Thanks!

1 Like

hi @Perri,

Can you please try reading the complete path in the read Text File

“c:\temp\sr-0001.txt” - If This works - then we can test for the dynamic variable.

Also , before the Set to ClipBoard - Plese use a writeline print output and see if we are getting data in output.


Mukesh

Hi @mukeshkala,

Thank you for the fast respond.

Getting this msg box for the path:
msg

Follow by error msg
Capture1

The program nv come to the write line msg.

Hi @kadiravan_kalidoss,
I’m using argument for the filename so thinking it may be the problem.
Please help. Thank you.

Can you share the text File You are trying to Read ?


Mukesh

1 Like

yeap! I’m running my bot in my laptop and rdp to server to perform tasks to save this file here. is it because of this reason.
SR-2020-0001.txt (1.1 KB)

This Sequence Works perfectly for me .

There is No issue with this part of code …

What exactly are we doing with RDP ?


Mukesh

1 Like

Thank u for ur help. I think it works locally but come to rdp, i need to use copy and paste. More steps to use but at least it worked😜

1 Like

Great to hear that :+1: