none
How to convert docx to html/css? RRS feed

  • Question

  • I have a docx file with so many images and text in it, i want to make it as a static page in my app so that user could switch between serveral same type of pages, how to do that ?

    I used htmlconverter but that didn't work?

    Please suggest !

    • Moved by Anna Cc Monday, August 18, 2014 8:03 AM
    Friday, August 15, 2014 12:52 PM

Answers

  • Hi,

    >> i want to make it as a static page in my app so that user could switch between serveral same type of pages<<

    I am not sure what do you mean switch between serveral same type of pages. But as far as I know, we can export Word document to HTML file using Document.SaveAs2. We also can get the similar code by recording macros, here is the code for your reference:

     ChangeFileOpenDirectory "C:\Users\UserName\Desktop\"
        ActiveDocument.SaveAs2 FileName:= _
            "HelloWord.htm", _
            FileFormat:=wdFormatHTML, LockComments:=False, Password:="", _
            AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
            EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
            :=False, SaveAsAOCELetter:=False, CompatibilityMode:=0

    In addition, Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.(refer to Considerations for server-side Automation of Office)

    Hope it is helpful.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 18, 2014 8:57 AM
    Moderator
  • The SaveAs method of the Document class allows to save the document in the HTML format. The WdSaveFormat enumeration contains the wdFormatHTML value which should be used for this.
    Monday, August 18, 2014 9:42 AM

All replies

  • Hi SureAzure,

    I'm moving this case to Word for Developers forum for better response.

    Thank you for your understanding!

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 18, 2014 8:04 AM
  • Hi,

    >> i want to make it as a static page in my app so that user could switch between serveral same type of pages<<

    I am not sure what do you mean switch between serveral same type of pages. But as far as I know, we can export Word document to HTML file using Document.SaveAs2. We also can get the similar code by recording macros, here is the code for your reference:

     ChangeFileOpenDirectory "C:\Users\UserName\Desktop\"
        ActiveDocument.SaveAs2 FileName:= _
            "HelloWord.htm", _
            FileFormat:=wdFormatHTML, LockComments:=False, Password:="", _
            AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
            EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
            :=False, SaveAsAOCELetter:=False, CompatibilityMode:=0

    In addition, Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.(refer to Considerations for server-side Automation of Office)

    Hope it is helpful.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 18, 2014 8:57 AM
    Moderator
  • The SaveAs method of the Document class allows to save the document in the HTML format. The WdSaveFormat enumeration contains the wdFormatHTML value which should be used for this.
    Monday, August 18, 2014 9:42 AM