{"id":1442,"date":"2024-02-10T13:23:44","date_gmt":"2024-02-10T20:23:44","guid":{"rendered":"https:\/\/www.ghosh.com\/blog\/?p=1442"},"modified":"2024-02-10T13:29:35","modified_gmt":"2024-02-10T20:29:35","slug":"from-screen-to-document-preserving-chatgpt-formatting-in-microsoft-word","status":"publish","type":"post","link":"https:\/\/www.ghosh.com\/blog\/from-screen-to-document-preserving-chatgpt-formatting-in-microsoft-word\/","title":{"rendered":"From Screen to Document: Preserving ChatGPT Formatting in Microsoft Word"},"content":{"rendered":"<div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1248px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-1\"><p><strong>Ever come across a gem of an answer from ChatGPT that you just need to save for later reference?<\/strong> You&#8217;re not alone. ChatGPT often provides responses that are not only insightful but also beautifully formatted, making the information easy to digest and follow.<\/p>\n<p><a href=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/ChatGPT-results.jpg\"><img decoding=\"async\" class=\"lazyload aligncenter wp-image-1443 size-full\" src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/ChatGPT-results.jpg\" data-orig-src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/ChatGPT-results.jpg\" alt=\"A screenshot of a ChatGPT result about a cryptocurrency.\" width=\"806\" height=\"837\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27806%27%20height%3D%27837%27%20viewBox%3D%270%200%20806%20837%27%3E%3Crect%20width%3D%27806%27%20height%3D%27837%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/ChatGPT-results-200x208.jpg 200w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/ChatGPT-results-289x300.jpg 289w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/ChatGPT-results-400x415.jpg 400w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/ChatGPT-results-600x623.jpg 600w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/ChatGPT-results-768x798.jpg 768w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/ChatGPT-results-800x831.jpg 800w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/ChatGPT-results.jpg 806w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 806px) 100vw, 806px\" \/><\/a><\/p>\n<p><strong>The challenge, however, arises when you try to preserve not just the content but the formatting as well.<\/strong> You might have noticed the &#8220;clipboard&#8221; icon <a href=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/clipboardicon.jpg\"><img decoding=\"async\" class=\"lazyload aligncenter size-full wp-image-1444\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27111%27%20height%3D%2737%27%20viewBox%3D%270%200%20111%2037%27%3E%3Crect%20width%3D%27111%27%20height%3D%2737%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-orig-src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/clipboardicon.jpg\" alt=\"\" width=\"111\" height=\"37\" \/><\/a> and used it to copy the answer, hoping to paste it into Microsoft Word with all its formatting glory intact. Yet, when you paste, you&#8217;re met with unformatted markdown text, far from what you expected.<\/p>\n<p><a href=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/markdown.jpg\"><img decoding=\"async\" class=\"lazyload aligncenter wp-image-1445 size-full\" src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/markdown.jpg\" data-orig-src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/markdown.jpg\" alt=\"The history of cryptography in markdown.\" width=\"683\" height=\"706\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27683%27%20height%3D%27706%27%20viewBox%3D%270%200%20683%20706%27%3E%3Crect%20width%3D%27683%27%20height%3D%27706%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/markdown-200x207.jpg 200w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/markdown-290x300.jpg 290w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/markdown-400x413.jpg 400w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/markdown-600x620.jpg 600w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/markdown.jpg 683w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 683px) 100vw, 683px\" \/><\/a><\/p>\n<p><strong>But there&#8217;s a workaround that seems promising at first:<\/strong> manually selecting the answer directly from the browser,<\/p>\n<p><a href=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/selectedresults.jpg\"><img decoding=\"async\" class=\"lazyload aligncenter wp-image-1446 size-full\" src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/selectedresults.jpg\" data-orig-src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/selectedresults.jpg\" alt=\"A screen shot of a page with a list of information.\" width=\"769\" height=\"702\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27769%27%20height%3D%27702%27%20viewBox%3D%270%200%20769%20702%27%3E%3Crect%20width%3D%27769%27%20height%3D%27702%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/selectedresults-200x183.jpg 200w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/selectedresults-300x274.jpg 300w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/selectedresults-400x365.jpg 400w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/selectedresults-600x548.jpg 600w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/selectedresults.jpg 769w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 769px) 100vw, 769px\" \/><\/a><\/p>\n<p>copying it, and then pasting it into Word. This method indeed transfers the formatted rich text, but it&#8217;s not perfect. You end up with some unsightly borders around lines and paragraphs, detracting from the original aesthetics seen in the browser.<\/p>\n<p><a href=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/withborders.jpg\"><img decoding=\"async\" class=\"lazyload aligncenter wp-image-1447 size-full\" src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/withborders.jpg\" data-orig-src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/withborders.jpg\" alt=\"A list of the history of cyrptocurrency.\" width=\"685\" height=\"788\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27685%27%20height%3D%27788%27%20viewBox%3D%270%200%20685%20788%27%3E%3Crect%20width%3D%27685%27%20height%3D%27788%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/withborders-200x230.jpg 200w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/withborders-261x300.jpg 261w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/withborders-400x460.jpg 400w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/withborders-600x690.jpg 600w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/withborders.jpg 685w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 685px) 100vw, 685px\" \/><\/a><\/p>\n<p><strong>Removing these lines, unfortunately, isn&#8217;t straightforward.<\/strong> If you opt to select all and clear all formatting in Word, you&#8217;re back to square one, losing much of the very formatting that you aimed to preserve.<\/p>\n<p><a href=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/tryingtoremoveformatting.jpg\"><img decoding=\"async\" class=\"lazyload aligncenter wp-image-1448 size-full\" src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/tryingtoremoveformatting.jpg\" data-orig-src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/tryingtoremoveformatting.jpg\" alt=\"The history of the british empire.\" width=\"672\" height=\"768\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27672%27%20height%3D%27768%27%20viewBox%3D%270%200%20672%20768%27%3E%3Crect%20width%3D%27672%27%20height%3D%27768%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/tryingtoremoveformatting-200x229.jpg 200w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/tryingtoremoveformatting-263x300.jpg 263w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/tryingtoremoveformatting-400x457.jpg 400w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/tryingtoremoveformatting-600x686.jpg 600w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/tryingtoremoveformatting.jpg 672w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 672px) 100vw, 672px\" \/><\/a><\/p>\n<p><strong>Here&#8217;s where a bit of VBScript magic comes into play.<\/strong> By running a simple script in Word, you can eliminate those pesky lines, ensuring that the transferred content from ChatGPT retains its formatting, looking almost identical to how it appeared in your web browser.<\/p>\n<pre><code class=\"language-visual-basic\" data-line=\"\">Sub CleanFormatOfChatGPTPaste()\n&#039;This is useful for removing borders when copy\/pasting from ChatGPT - 2\/10\/24 Samir Ghosh.com\n\n    Dim para As Paragraph\n    Dim range As range\n\n    &#039;Remove borders for each paragraph\n    For Each para In ActiveDocument.Paragraphs\n        Set range = para.range\n        range.MoveEnd Unit:=wdCharacter, Count:=-1 &#039; Move end of range to exclude paragraph mark\n        range.Borders.Enable = False\n    Next para\n    \n    &#039;Select entire document and remove any document-wide borders\n    With ActiveDocument\n        .Select\n        Selection.Borders.Enable = False\n    End With\nEnd Sub\n<\/code><\/pre>\n<p>Here&#8217;s how to add VB code as a Macro in Microsoft Word in concise steps:<\/p>\n<ol>\n<li><strong>Open Microsoft Word:<\/strong> Start by opening the document you want to add a macro to or just open Word to create a new document.<\/li>\n<li><strong>Access the Developer Tab:<\/strong>\n<ul>\n<li>If the Developer tab is not already visible, go to <code class=\"\" data-line=\"\">File<\/code> &gt; <code class=\"\" data-line=\"\">Options<\/code> &gt; <code class=\"\" data-line=\"\">Customize Ribbon<\/code>.<\/li>\n<li>Check the box next to &#8220;Developer&#8221; in the right column and click <code class=\"\" data-line=\"\">OK<\/code>.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Open the Visual Basic Editor:<\/strong>\n<ul>\n<li>Click on the <code class=\"\" data-line=\"\">Developer<\/code> tab on the Ribbon.<\/li>\n<li>Press <code class=\"\" data-line=\"\">Visual Basic<\/code> to open the Visual Basic for Applications (VBA) editor.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Insert a New Module:<\/strong>\n<ul>\n<li>In the VBA editor, right-click on <code class=\"\" data-line=\"\">ThisDocument<\/code> of your open document listed in the Project window on the left side.<\/li>\n<li>Select <code class=\"\" data-line=\"\">Insert<\/code> &gt; <code class=\"\" data-line=\"\">Module<\/code> to add a new module for your macro code.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Enter Your VB Code:<\/strong>\n<ul>\n<li>In the newly created module window, type or paste your VB (VBA) script.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Save Your Macro:<\/strong>\n<ul>\n<li>Press <code class=\"\" data-line=\"\">Ctrl + S<\/code> to save your macro. Close the VBA editor and return to your Word document.<\/li>\n<li>Note: If you haven&#8217;t saved your document as a macro-enabled document, you&#8217;ll need to do so by choosing <code class=\"\" data-line=\"\">File<\/code> &gt; <code class=\"\" data-line=\"\">Save As<\/code> and selecting &#8220;Word Macro-Enabled Document (*.docm)&#8221; as the file type.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Run Your Macro:<\/strong>\n<ul>\n<li>Back in Word, on the <code class=\"\" data-line=\"\">Developer<\/code> tab, click <code class=\"\" data-line=\"\">Macros<\/code>.<\/li>\n<li>Select your macro from the list and click <code class=\"\" data-line=\"\">Run<\/code>.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>These steps will allow you to add and execute VB code as a macro within Microsoft Word, automating tasks and customizing your document processing workflow.<\/p>\n<p>This method ensures that you can keep the insights and formatting from ChatGPT, making your documentation process smoother and your documents more visually appealing. Whether you&#8217;re saving snippets for personal reference, academic purposes, or professional documentation, this technique is a game-changer in preserving the integrity of formatted information transferred from digital assistant platforms to Microsoft Word.<\/p>\n<p><a href=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/final.jpg\"><img decoding=\"async\" class=\"lazyload aligncenter wp-image-1449 size-full\" src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/final.jpg\" data-orig-src=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/final.jpg\" alt=\"A paper with text and images.\" width=\"748\" height=\"787\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%27748%27%20height%3D%27787%27%20viewBox%3D%270%200%20748%20787%27%3E%3Crect%20width%3D%27748%27%20height%3D%27787%27%20fill-opacity%3D%220%22%2F%3E%3C%2Fsvg%3E\" data-srcset=\"https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/final-200x210.jpg 200w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/final-285x300.jpg 285w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/final-400x421.jpg 400w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/final-600x631.jpg 600w, https:\/\/www.ghosh.com\/blog\/wp-content\/uploads\/2024\/02\/final.jpg 748w\" data-sizes=\"auto\" data-orig-sizes=\"(max-width: 748px) 100vw, 748px\" \/><\/a><\/p>\n<\/div><\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1453,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,1],"tags":[],"class_list":["post-1442","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-artificial-intelligence","category-general"],"_links":{"self":[{"href":"https:\/\/www.ghosh.com\/blog\/wp-json\/wp\/v2\/posts\/1442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ghosh.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ghosh.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ghosh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ghosh.com\/blog\/wp-json\/wp\/v2\/comments?post=1442"}],"version-history":[{"count":4,"href":"https:\/\/www.ghosh.com\/blog\/wp-json\/wp\/v2\/posts\/1442\/revisions"}],"predecessor-version":[{"id":1461,"href":"https:\/\/www.ghosh.com\/blog\/wp-json\/wp\/v2\/posts\/1442\/revisions\/1461"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ghosh.com\/blog\/wp-json\/wp\/v2\/media\/1453"}],"wp:attachment":[{"href":"https:\/\/www.ghosh.com\/blog\/wp-json\/wp\/v2\/media?parent=1442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ghosh.com\/blog\/wp-json\/wp\/v2\/categories?post=1442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ghosh.com\/blog\/wp-json\/wp\/v2\/tags?post=1442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}