Word to HMTL

S

Shin

Hi All

please can someone help, does anyone know how to autosave a word doucument
into hmtl format?

Thanks in advance
Shin
 
P

Peter

The following sub will autosave the active document as an html file named "filename.html" in the current directory every 2 minutes.

Public Sub HTMLSave()
If ActiveDocument.SaveFormat <> wdFormatHTML Then
Call ActiveDocument.SaveAs("filename.html", wdFormatHTML)
Else
Call ActiveDocument.Save
End If
Call Application.OnTime(Now + TimeSerial(0, 2, 0), "Module1.HTMLSave")
End Sub

You have to initially invoke the sub in order to set the timer going; that can be done from a custom button, or an AutoOpen/New/Exec macro, or wherever.

Note that the sub as written has to be in the module named "Module1". If you place it somewhere else or rename it, change the OnTime() invocation accordingly.

hth,

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top