Skip to content Skip to sidebar Skip to footer

Copy To Clipboard With Font Style

I'm looking for a way to copy some div text with JavaScript copying the style (italics, font family, size, etc.) so I can paste it into Word and look the same as the page. If I wan

Solution 1:

Well, when you copy text from a web browser, what you copy is only the text. The appliance of any style is job of the web browser. Now, in this case though, styles can be applied into a Word document, so what you can is to first of all copy the plain text without the styles to Word. Then, you can make CSS file with all the styles that you want to apply into this document(Grouping all your styles in css files is a generally good practice, instead of using or and so on..). Then, you can apply this style into the document. Now because obviously your question might be: "How do I apply the style into the document?", there has already be done a discussion about that here: https://superuser.com/questions/65107/how-to-apply-external-css-stylesheet-to-document-in-microsoft-word

Hope it helped!

Post a Comment for "Copy To Clipboard With Font Style"