Using Office for software document conversion?

I am interested in using Office 2007 to convert between pre-2007 binary formats (.doc, .xls, .ppt) and the new Office Open XML formats (.docx, .xlsx, .pptx)

How should I do it? I would like to write a simple command line application that takes two file names (input and output) and, possibly, the source and / or destination, and performs the conversion.

+3
source share
2 answers

Microsoft has a page that gives some examples of scripting for the MS Word β€œdrive”. One such example shows how to convert from a Word document to HTML. By changing the last parameter to any of the values ​​listed here , you can get output in different formats.

+2
source

The easiest way is to use Automation through Microsoft.Office.Interop. libraries. For example, you can create an instance of a Word application. Methods are applied to the Application object that will allow you to open and close documents, as well as much more that you can perform in VBA by writing a macro.

VBA Office, . , #, VB.NET VBA.

0

Source: https://habr.com/ru/post/1696599/


All Articles