Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Kalgoorlie, Western Australia, Australia
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Save As HTML from a Macro (97)

    Does anyone know how to save a Word file as HTML from a Macro?

    Thanks for your help

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Save As HTML from a Macro (97)

    I have Word2000, so this might not be the same...

    I thought at first that there might be a converter you could use with the .SaveAs method. In 2000, it's called wdFormatHTML. Since Word97 apparently did not have a special constant for HTML, I wrote a little discovery routine to smoke out the converters:

    <pre>Sub ListConverters()
    Dim cnv As FileConverter
    For Each cnv In FileConverters
    If cnv.Application = "Microsoft Word" Then
    On Error GoTo NoSaveFormat
    Debug.Print cnv.SaveFormat & " - "; cnv.Name & " - " & cnv.FormatName
    MoreFormats:
    End If
    Next
    Exit Sub

    NoSaveFormat:
    Debug.Print "N/A - "; cnv.Name & " - " & cnv.FormatName
    Resume MoreFormats
    End Sub</pre>

    But I didn't find the HTML one there on 2000. Maybe you will find one for 97? If not, perhaps a spin through the MS Knowlege Base will pop up an answer.

Posting Permissions

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