HTML filter 2.0

G

George Hester

Doesn't work in Microsoft Office 2003 new install. I suspect it would have worked in a upgrade to Microsoft Office 2003. How can we do in Microsoft Office 2003 what HTML filter 2.0 did for us in Microsoft Offices 2000 and XP? Thanks.
 
B

Bob Buckland ?:-\)

Hi George,

Not quite sure what you're referring to as far as what
it 'did for us'. In Office XP/2002 and Office 2003
the File=>Save as=>Web Page-Filtered choice along with
settings in Tools=>Options=>General=>Web Options,
Tools=>Options=>Compatability and Tools=>Options=>Security/Privacy
replaced the HTML Filter v2.

If you're referring to the MSFilter.exe batch process
(external to Word 2000) it still runs independently
and can process Word 2003 HTML files.

=======
Doesn't work in Microsoft Office 2003 new install. I suspect it would have worked in a upgrade to Microsoft Office 2003. How can
we do in Microsoft Office 2003 what HTML filter 2.0 did for us in Microsoft Offices 2000 and XP? Thanks.

--
George Hester>>
--
I hope this helps you,

Bob Buckland ?:)
MS Office System Products MVP

*Courtesy is not expensive and can pay big dividends*

The Office 2003 System parts explained
http://microsoft.com/uk/office/editions.asp
 
G

George Hester

Hi Bob:

Looks like this in a VBA module:

Public Declare Function MSPeelerMain Lib "msfilter.dll" _
(ByVal sHtmlFile As String, _
ByVal sCmdOptions As String) As Integer
'This is the output file for the example; change as needed
Private Const c_sOutputFile As String = "C:\MyNewHTMLFile.htm"
Public Sub SaveAsSimpleHTML(sDocFile As String)
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
On Error GoTo Err_Routine
'Launch Microsoft Word and open a test document
Set wdApp = New Word.Application
Set wdDoc = wdApp.Documents.Open(sDocFile)
wdApp.Visible = False
'Save the test document as HTML (includes XML data islands)
wdDoc.SaveAs c_sOutputFile, 8 '(wdFormatHTML)
'Close the test document and quit Word
'NOTE: The document must be closed before the XML can be removed
'because Word maintains an exclusive file lock
wdDoc.Close
wdApp.Quit
'Make sure Word has time to shut down properly
DoEvents
'If the filter is installed, remove the extra XML
MSPeelerMain c_sOutputFile, "-tfrb"
MsgBox "The current file was saved as plain HTML." & _
vbCrLf & "Location: " & c_sOutputFile
Exit Sub
Err_Routine:
If Err.Number = 53 Then
'File not found would be if the DLL could not be found, which
'would mean that the filter is not installed on this computer
MsgBox "The HTML Filter 2.0 DLL is not installed"
Err.Clear
Resume Next
Else
MsgBox "An error occurred: " & str(Err.Number) & _
" - " & Err.Description, vbCritical
End If
End Sub

Without the HTML Filter the html has all the Word schema tags in it. With the filter the html that is produced using this module is "clean" html. That is HTML Filter removes the Word schema stuff. Without that filter in Office 2003 we don't get twhat the HTML Filter did for us in Offices 2000 and XP.

This is a self-contained module. Just pop it in any Office application that supports VBA in both Office that has the filter and one that does not (like Office 2003) and you will see the difference in the output MyNewHTMLFile.htm. How else are we going to achieve the same result in Office 2003 as we can in Office 2000 and XP with the filter installed prigrammatically?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top