Consulting

Results 1 to 2 of 2

Thread: Convert Word document in HTML via Excel

  1. #1

    Convert Word document in HTML via Excel

    I have a problem, maybe someone can help me.
    From Excel, through VBA I want open a Word document (docx) and convert and save to HTML.
    I tried a method but has given a disappointing result. I attach.
    I recorded a macro in Word and I pasted in Excel.

    Public objWord As Object
    
    Sub deschidWord()
    Dim texta(10) As String
    Dim ws As Worksheet
    
            Set objWord = CreateObject("Word.Application")
            objWord.Visible = True
            loca = d.Cells(1, 1) ' my word file name
            objWord.Documents.Open loca
    
    
        objWord.ActiveDocument.SaveAs2 Filename:="D:\proba.htm", FileFormat:= _
            wdFormatFilteredHTML, LockComments:=False, Password:="", AddToRecentFiles _
            :=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _
            :=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
            SaveAsAOCELetter:=False, CompatibilityMode:=0
    
    End Sub
    
    Sub inchidWord()
            objWord.ActiveDocument.Close
          objWord.Quit
    End Sub
    A better idea?
    Attached Files Attached Files

  2. #2
    as there is no way to tell from the sample as to how it is supposed to look, i can only suggest to
    parse the document and write your own html

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •