Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Nov 14, 2022 8:54 pm

Is there a way to virtually select everything in a docx document and copy into the clipboard?

I would like to create a c# function that would take the filename of a document, and put it into the clipboard as if it were being copied with control-C.

Thank you,

Popinjay
 
Posts: 2
Joined: Mon Nov 14, 2022 8:51 pm

Tue Nov 15, 2022 9:41 am

Hello,

Thanks for your inquiry.
Sorry that our product don’t support copy the file name and the content of document into clipboard. However, you can use “System.Windows.Forms.Clipboard” to achieve your requirement. I put my test project into our server for your reference, you can download it from the following link.
If you have any issue, just feel free to contact us.

https://www.e-iceblue.com/downloads/att ... p31459.zip

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Tue Nov 15, 2022 6:54 pm

Thank you for such a quick reply, but there is one issue.

This copies, but doesn't copy the formatting. I would like to copy the formatting as .RTF to put into the box. For example, just as if I were to have hit control-C with all the text selected in Word and then control-v into the richtextbox.

Is there a modification that would allow this?

Thanks,

Popinjay
 
Posts: 2
Joined: Mon Nov 14, 2022 8:51 pm

Wed Nov 16, 2022 7:20 am

Hello,

Thanks for your feedback.
After investigation, sorry that I don’t find a method to meet your requirement.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.Doc

cron