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

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,649 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 29,261 Reputation points Microsoft Vendor
    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