Automating Word - SaveAs(HTML) How interfaces work?
The above code found in:
http://msdn.microsoft.com/library/de...7/html/w2h.asp
that saves any word document in html format doesn't work with vb .net.
It says at compile time:
"'FileConverters' is a type in 'Word' and cannot be used as an expression"
I've search for the definition of "FileConverters" and found out it is an Interface. Well... I don't now much about it and how to solve this problem!
Thanks!
------------------------------------------------------------------------------
Sub HTMLSave()
' This procedure steps through the FileConverters collection
' looking for the HTML converter, and then converts the current file.
Dim wrdConverter As Word.FileConverter
Dim strMessage As String
Dim strPath As String
'Get a name and location for the converted file.
strMessage = "Enter a path and file name for the converted file."
strPath = InputBox(strMessage)
For Each wrdConverter In Word.FileConverters '<-- HERE!!!
'If found, Save As, then exit the loop.
If wrdConverter.ClassName = "HTML" Then
ActiveDocument.SaveAs _
FileName:=strPath, _
FileFormat:=wrdConverter.SaveFormat
Exit For
End If
Next wrdConverter
End Sub