At first, let the user select a file to import. Then call Vim to make the text file a HTML file. Finally get the current text cursor and get its "XDocumentInsertable" interface to import the html file at the current position. If there is the need to change the paragraphs background as well, create a new paragraph style named code. There is also a snippet showing how to create such a paragraph style automatically. For further details see http://wi.wu-wien.ac.at/rgf/diplomarbeiten/BakkStuff/2008/200809_Frysak/200809_Frysak_Automating_OOo_ooRexx_Nutshells.pdf. To use the example, you must install Vim and its graphical interface GVim. Furthermore the installationpath must be added to the system path variable to allow this example to find Vim and GVim. Additionally your document should contain a paragraph style named "code" (without "") to define the background and so on. |