Copy and modify text on-the-fly in MS Word 2010/2013

1

I would like to know if there is a plugin or something similar (macro? don't know) what will apply MS Word styles on-the-fly after pasting some text into the document. Current MS Word's way of preserving styles is not an option (or maybe I can't use it). From what I've tested when I paste some kind of simple HTML

ex.

<h1>Heading</h1>
<h2>Header 2</h2>
<p>Paragraph 1 bla bla</p>
<p>Alalalalala</p>
<pre>This is code</pre>

Ms Word will just apply hardcoded styles directly from HTML. And I would like to apply defined styles. Generally I'm expecting some kind of mapping

h1 => MS Word Header 1
h2 => MS Word Header 2
p => MS Word Normal Text
pre => MS Word Code Style (custom or something like that)

I would like to paste HTML (or Markdown in next stages) and run some kind of plugin/parser, which will do the mapping and apply the styles automagically.

ex.

<h1 class="header-1">Header 1</h1>
<p class="special-style">This is paragraph with a special style</p>

This should be mapped to "MS Word Header 1" and "Special style".

Anyone's done something like that? Or can give me a hints how to write an extension for MS Word to do that? Is there any way to:

  1. Get current cursor position
  2. Grap text from the clipboard
  3. Process/apply styles
  4. Append it in current cursor position

It doesn't have to be CTRL+V, I can do CTRL+C on a HTML source code and paste it with some other shortcut :)

Simon

Posted 2013-07-12T21:45:48.957

Reputation: 173

No answers