// Spludlow Software
// Copyright © Samuel P. Ludlow 2020 All Rights Reserved
// Distributed under the terms of the GNU General Public License version 3
// Distributed WITHOUT ANY WARRANTY; without implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
// https://www.spludlow.co.uk/LICENCE.TXT
// The Spludlow logo is a registered trademark of Samuel P. Ludlow and may not be used without permission
// v1.14
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Data;
using Microsoft.Office.Interop.Word;
namespace Spludlow.Office
{
///
/// Automating Word
///
public class Word
{
///
/// Save work doc as HTML
///
public static void SaveHtml(string wordFilename, string htmlFilename)
{
Application application = new Application();
try
{
Document document = application.Documents.Open(wordFilename);
try
{
document.SaveAs2(htmlFilename, WdSaveFormat.wdFormatFilteredHTML);
}
finally
{
document.Close(false);
}
}
finally
{
application.Quit();
}
}
}
}