1 | ' Credit goes to Cuzuco's post:
|
---|
2 | ' http://www.oooforum.org/forum/viewtopic.phtml?t=31818
|
---|
3 |
|
---|
4 | Sub SaveAsHTML( cFile )
|
---|
5 | cURL = ConvertToURL( cFile )
|
---|
6 | ' Open the document. Just blindly assume that the document
|
---|
7 | ' is of a type that OOo will correctly recognize and open
|
---|
8 | ' without specifying an import filter.
|
---|
9 | oDoc = StarDesktop.loadComponentFromURL( cURL, "_blank", 0, _
|
---|
10 | Array(MakePropertyValue( "Hidden", True ),))
|
---|
11 |
|
---|
12 | Select Case LCase(Right(cFile,3))
|
---|
13 | Case "pdf" ' PowerPoint file.
|
---|
14 | LeFilter = " writer_web_pdf_Export"
|
---|
15 | Case "ppt" ' PowerPoint file.
|
---|
16 | LeFilter = "impress_html_Export"
|
---|
17 | Case "pps" ' PowerPoint file.
|
---|
18 | LeFilter = "impress_html_Export"
|
---|
19 | Case "doc" ' Word file.
|
---|
20 | LeFilter = "HTML (StarWriter)"
|
---|
21 | Case "xls" ' Excel file.
|
---|
22 | LeFilter = "HTML (StarCalc)"
|
---|
23 | Case Else
|
---|
24 | LeFilter = "xxx"
|
---|
25 | End Select
|
---|
26 |
|
---|
27 | cFile = Left( cFile, Len( cFile ) - 4 ) + ".html"
|
---|
28 | cURL = ConvertToURL( cFile )
|
---|
29 |
|
---|
30 | ' Save the document using a filter.
|
---|
31 | oDoc.storeToURL( cURL, Array(_
|
---|
32 | MakePropertyValue( "FilterName", LeFilter ),)
|
---|
33 |
|
---|
34 | oDoc.close( True )
|
---|
35 | End Sub
|
---|
36 |
|
---|