Hi All,
I am looking for help to convert word docs to HTML using Open Office API. Please advise which packages (namespaces) should I use from Open Office to convert word docs to HTML in my code? I can find these packages in MS word API, but can't find in Open Office. Please help?
Thanks,
[Solved] Convert Word docs to HTML Using API
[Solved] Convert Word docs to HTML Using API
Last edited by Hagar Delest on Thu Oct 06, 2016 9:45 pm, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
OpenOffice 4.1 on Windows 10
- JohnSUN-Pensioner
- Volunteer
- Posts: 876
- Joined: Fri Jan 14, 2011 1:21 pm
- Location: Kyiv, Ukraine
Re: Convert Word docs to HTML Using API
See Andrew Pitonyak "Useful Macro Information" - chapter 5.17.1. Filter names and Listing 5.44: Export a document.
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
Re: Convert Word docs to HTML Using API
Thanks for the reply.
Here is my use case.
I want to upload the word doc in my application, and want to see it in the browser in HTML format. I will really appreciate if you can help me with the code on how to take in word doc and convert it to HTML in the browser. I am using C# .NET for my development. Please help!
Thanks in advance.
Here is my use case.
I want to upload the word doc in my application, and want to see it in the browser in HTML format. I will really appreciate if you can help me with the code on how to take in word doc and convert it to HTML in the browser. I am using C# .NET for my development. Please help!
Thanks in advance.
OpenOffice 4.1 on Windows 10
Re: Convert Word docs to HTML Using API
This is totally unrelated to OpenOffice.
OpenOffice is the reference application for the Open Document Format.
https://en.wikipedia.org/wiki/Apache_OpenOffice
OpenOffice is the reference application for the Open Document Format.
https://en.wikipedia.org/wiki/Apache_OpenOffice
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Volunteer
- Posts: 1549
- Joined: Wed Jun 24, 2015 12:56 am
- Location: Colorado, USA
Re: Convert Word docs to HTML Using API
Here is the Basic code to export the current OO Writer document as HTML
I've never used C#.NET so I can't say how to translate this to your application. Generally the API calls are the same, but declaring the variables and setting up the array will probably need to be changed.
Code: Select all
REM ***** BASIC *****
Sub SaveDocAsHTML
DIM sURL as string
Dim args2(1) As New com.sun.star.beans.PropertyValue
oDoc = ThisComponent
args2(0).Name = "InteractionHandler"
args2(0).Value = ""
args2(1).Name = "FilterName"
args2(1).Value = "HTML (StarWriter)" '"HTML" REM One of the HTML export filters
REM Use the correct file extension
sURL = "file:///c:/Users/Owner/test_file.html"
oDoc.storeToURL(sURL,args2())
End Sub
Last edited by UnklDonald418 on Thu Oct 06, 2016 5:52 pm, edited 1 time in total.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11