I have a large number of DOC files that I need to be able to view via a access form. I am able to use the webbrowser object on an ACCESS form and open htm files. With this I can control the size and the placement on the screen. I would like to be able to control these Word docs the same way, but I have been unable to create an ACCESS form with the linked word format so it can be updated dynamically for source document. My other option was to take a VBA module, open the Word object and save it as a HTML. My code is below. This works fine and I can go through a directory with 200 doc files very comfortable. The only problem is, for every document it creates a new sub folder with the document name and the controls for the particular HTM document. If you delete the control folder, you also get the HTM document. I must allocate space for both the HTM and the control folder. Makes it hard to move it around on the network and point users to it.
So I have 2 problems. Is there a way to dynamically populate an object on an ACCESS form with a Word document? Is there a way to create these HTM documents without the need for the control folders.
Thanks for your assistance.
Function convdatahtml() As Variant
Dim myfile
Dim objwd As Word.Application
Set objwd = CreateObject("word.application"
myfile = Dir("c:\doc\*.doc"
Do While myfile <> ""
objwd.Documents.Open ("c:\doc\" + myfile)
objwd.ActiveDocument.SaveAs filename:="c:\doc\" + (Left(myfile, Len(myfile) - 4)) + ".html", fileformat:=wdFormatHTML
objwd.ActiveDocument.Close
myfile = Dir
Loop
objwd.Quit
Set objwd = Nothing
End Function
So I have 2 problems. Is there a way to dynamically populate an object on an ACCESS form with a Word document? Is there a way to create these HTM documents without the need for the control folders.
Thanks for your assistance.
Function convdatahtml() As Variant
Dim myfile
Dim objwd As Word.Application
Set objwd = CreateObject("word.application"
myfile = Dir("c:\doc\*.doc"
Do While myfile <> ""
objwd.Documents.Open ("c:\doc\" + myfile)
objwd.ActiveDocument.SaveAs filename:="c:\doc\" + (Left(myfile, Len(myfile) - 4)) + ".html", fileformat:=wdFormatHTML
objwd.ActiveDocument.Close
myfile = Dir
Loop
objwd.Quit
Set objwd = Nothing
End Function