Hi all,
need a quick help. I am trying from Excel vba to open a word document (2010 version) and save it as a .htm format. I tried different solutions but nothing seems to work. Here is my code. It works without error but when I open the .htm file it is all gibberish. I want as well to keep this code with late binding.
Appreciate your input on this
Sub openExistingWordFile()
Dim oWord As Object
Set oWord = CreateObject(Class:="Word.Application")
oWord.Visible = True
oWord.Documents.Open Filename:="D:\Application\VBA\test.docx" ' OPEN AN EXISTING FILE.
oWord.Activate
oWord.ActiveDocument.SaveAs Filename:="D:\Application\VBA\test.htm", FileFormat:=wdFormatHTML
oWord.Quit
Set oWord = Nothing
End Sub
need a quick help. I am trying from Excel vba to open a word document (2010 version) and save it as a .htm format. I tried different solutions but nothing seems to work. Here is my code. It works without error but when I open the .htm file it is all gibberish. I want as well to keep this code with late binding.
Appreciate your input on this
Sub openExistingWordFile()
Dim oWord As Object
Set oWord = CreateObject(Class:="Word.Application")
oWord.Visible = True
oWord.Documents.Open Filename:="D:\Application\VBA\test.docx" ' OPEN AN EXISTING FILE.
oWord.Activate
oWord.ActiveDocument.SaveAs Filename:="D:\Application\VBA\test.htm", FileFormat:=wdFormatHTML
oWord.Quit
Set oWord = Nothing
End Sub