Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • Last Modified:

I need to be able to access Microsoft Word documents *.doc ( I do not need to access formatting, just bare text )

from within VB to convert them into .html format.

Thanks in advance,
-Alex
0
AlexF777
Asked:
AlexF777
  • 2
2 Solutions
 
mladenoviczCommented:

    Dim WordApp As New Word.Application
    Dim WordDoc As Word.Document
   
    Set WordDoc = WordApp.Documents.Open("C:\a.doc")
    WordDoc.SaveAs "C:\a.html", wdFormatHTML
   
    WordDoc.Close
   
    Set WordDoc = Nothing
    Set WordApp = Nothing

You will need reference to MS Word
0
 
mladenoviczCommented:
If you want pure text use wdFormatText  - Saves text without formatting. Converts all section breaks, page breaks, and new line characters to paragraph marks. Uses the ANSI character set. Use this format if the destination program cannot read any of the other available file formats.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now