T
Tony Logan
Actually it won't even display in my list of macros when I access the Macro dialog box, although in the VBE, I can see all the coding. When I try to run the macro from the VBE, nothing happens. I'm stumped as to what to try to troubleshoot
The article in question is "HOWTO: Programmatically Use the HTML Filter DLL to Save Word Documents as Plain HTML," at http://support.microsoft.com/default.aspx?scid=291325
I'm running Word 2000 on Windows NT 4.0
Below is the code in its entirety, directly from the article, without any modification on my part
Private Declare Function MSPeelerMain Lib "msfilter.dll"
(ByVal sHtmlFile As String, ByVal sCmdOptions As String) As Intege
' 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 Objec
Dim wdDoc As Objec
On Error GoTo Err_Routin
'Launch Microsoft Word and open a test document
Set wdApp = CreateObject("Word.Application"
Set wdDoc = wdApp.Documents.Open( sDocFile
' Save the test document as HTML (includes XML data islands)
wdDoc.SaveAs c_sOutputFile, 8 '(wdFormatHTML
'Close the test document and quit Microsoft Word
'NOTE: The document must be closed before the XML can be remove
'because Word maintains an exclusive file lock
wdDoc.Clos
wdApp.Qui
'Make sure Word has time to shut down properly
DoEvent
'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_sOutputFil
Exit Su
Err_Routine
If Err.Number = 53 The
' File not found would be if the DLL could not be found, whic
' would mean that the Filter is not installed on this computer
MsgBox "The HTML Filter 2.0 DLL is not installed.
Err.Clea
Resume Nex
Els
MsgBox "An error occurred: " & Str(Err.Number) &
" - " & Err.Description, vbCritica
End I
End Sub
The article in question is "HOWTO: Programmatically Use the HTML Filter DLL to Save Word Documents as Plain HTML," at http://support.microsoft.com/default.aspx?scid=291325
I'm running Word 2000 on Windows NT 4.0
Below is the code in its entirety, directly from the article, without any modification on my part
Private Declare Function MSPeelerMain Lib "msfilter.dll"
(ByVal sHtmlFile As String, ByVal sCmdOptions As String) As Intege
' 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 Objec
Dim wdDoc As Objec
On Error GoTo Err_Routin
'Launch Microsoft Word and open a test document
Set wdApp = CreateObject("Word.Application"
Set wdDoc = wdApp.Documents.Open( sDocFile
' Save the test document as HTML (includes XML data islands)
wdDoc.SaveAs c_sOutputFile, 8 '(wdFormatHTML
'Close the test document and quit Microsoft Word
'NOTE: The document must be closed before the XML can be remove
'because Word maintains an exclusive file lock
wdDoc.Clos
wdApp.Qui
'Make sure Word has time to shut down properly
DoEvent
'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_sOutputFil
Exit Su
Err_Routine
If Err.Number = 53 The
' File not found would be if the DLL could not be found, whic
' would mean that the Filter is not installed on this computer
MsgBox "The HTML Filter 2.0 DLL is not installed.
Err.Clea
Resume Nex
Els
MsgBox "An error occurred: " & Str(Err.Number) &
" - " & Err.Description, vbCritica
End I
End Sub