webBrowser.Document.ExecCommand("Copy", false, null) not working C#

Srinivas Merugu (Optum Software) 0 Reputation points
2023-04-18T13:09:36.1066667+00:00

Hi Team, webBrowser.Document.ExecCommand("Copy", false, null); is not working and not able to paste the content in richtextbox in C#. It is not copying into clipboard too. Do you have any idea? Kindly suggest. Thanks, Srinivas Merugu

Developer technologies | C#
{count} votes

1 answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 34,221 Reputation points Microsoft External Staff
    2023-04-19T02:14:35.11+00:00

    Hi, @Srinivas Merugu (Optum Software) ,

    Make sure you select the content you want to copy before using webBrowser.Document.ExecCommand("Copy", false, null).

    Use webBrowser.DocumentText to check that all the text in the page has loaded.

    Best Regards.

    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.