Copy and paste from docx file

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Marco N
Posts: 16
Joined: 30 Oct 2021, 16:17

Copy and paste from docx file

Post by Marco N » 20 Jan 2024, 14:18

Hi, I would like to copy and paste a text from a docx file into a Gmail email. Is this possible?

Marco N
Posts: 16
Joined: 30 Oct 2021, 16:17

Re: Copy and paste from docx file

Post by Marco N » 21 Jan 2024, 11:48

I found this snippet that seems to copy the contents of the docx file correctly but pasting doesn't work (manual only)

Code: Select all

FilePath := "C:\Users\MN\OneDrive\Lavoro\DocAziendali\Rilascio CD\Risposte pronte per la spedizione di CD.docx"

F9::
oDoc := ComObjGet(FilePath)
oDoc.Range.FormattedText.Copy
oDoc.Close(0)
Send ^v
return

User avatar
lmstearn
Posts: 698
Joined: 11 Aug 2016, 02:32
Contact:

Re: Copy and paste from docx file

Post by lmstearn » 23 Jan 2024, 09:55

No personal experience in gmail client, just a couple of pointers:
From an outside thread:
When you compose an email in Gmail, in the lower right corner, you have a small drop down arrow for "More options". Make sure that "Plain Text Mode" is UNCHECKED.
Try converting the docx into rtf - may lose some formatting, and is probably not going to work anyhow (like this), in which case the only option (apart from switching mail client) is to add the content as an attachment.
Related:
Pasting a word document into the body of an email
Paste rich text
What is the easiest way to format code when pasting to Gmail?
:arrow: itros "ylbbub eht tuO kaerB" a ni kcuts m'I pleH

Marco N
Posts: 16
Joined: 30 Oct 2021, 16:17

Re: Copy and paste from docx file

Post by Marco N » 24 Jan 2024, 13:12

Thanks for your help. I'll try to see.

Post Reply

Return to “Ask for Help (v1)”