vs 2022 – copy/paste from vs to ms word is not in color

iqworks Information Quality Works 276 Reputation points
2024-05-10T19:29:15.1966667+00:00

Hi, coping text from vs 2022 to ms word shows no color. This happened in vs 2017,19, but fixed that. I cannot seem to find the fix for vs 2022. Here is what I tried.  

Download power tools with productivity tools 2022.

 https://stackoverflow.com/questions/62191550/copy-the-code-text-from-ms-visual-studio-and-keeping-the-source-color-and-format Tools --> options --> Text Editor --> Advanced --> Copy rich text on copy/cut (checked) --> Max Length (a very big number) 

https://stackoverflow.com/questions/55209429/how-to-copy-code-from-visual-studio-to-ms-word-with-every-highlight-exactly-as-i So I was looking for an answer to this and this is what i found. Go to Extensions (manager) -> look for: Productivity Power Tools -> install & restart VS. Now when i copy/paste from VS to Word, literally all syntax colors are being copied over 1:1. even the background color is matched.

None seems to work? 

Thanks for any advice or suggestions

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,690 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anna Xiu-MSFT 26,566 Reputation points Microsoft Vendor
    2024-05-14T07:27:12.5033333+00:00

    Hi @iqworks Information Quality Works

    Welcome to Microsoft Q&A! 

    I am sorry to say that it is a known issue with the option “Copy rich text on Copy/Cut” for VS2022. It has been reported to Product Team:

    Rich copy/paste of C# source code into Office fails in the latest Visual Studio preview - Developer Community 

    As indicated by the conversation, the fix is scheduled to be released as part of 17.11 Preview 1. You can vote on that ticket to follow the progress. 

    Thanks for your understanding! 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".  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

1 additional answer

Sort by: Most helpful
  1. Michael Taylor 49,246 Reputation points
    2024-05-10T20:45:18.23+00:00

    Check their Github repo. It states there that it doesn't work for VS 2022 and there is no timeframe for a fix.

    0 comments No comments