I'd like to use send highlighted text from .org documents to the clipboard in the docx format. I've tried the following:
(defun region-to-clip ()
"Copies region between point and mark to the clipboard"
(interactive)
(shell-command-on-region
(mark)
(point)
"pandoc -f org -t docx | xclip -sel clip &> /dev/null"))
Testing this with the following org text:
****** Heading 1
******* Heading 2
1. Element 1
2. Element 2
gives:
PK###
when pasted into Libre Office. I get the same result using odt as the target output from pandoc, but something more reasonable if I choose markdown. The markdown is ok, but ultimately I'd like to also take advantage of pandoc's reference-doc for formatting docx output.