Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Tagged as

Word2CHM, Convert a Word Document to a CHM File

, 17 Nov 2010 CPOL
Word2CHM, convert a Word document to a CHM file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Word2CHM
{
    /// <summary>
    /// configration dialog
    /// </summary>
    public partial class dlgConfig : Form
    {
        public dlgConfig()
        {
            InitializeComponent();
             
            this.DialogResult = DialogResult.Cancel;
        }

        private void dlgConfig_Load(object sender, EventArgs e)
        {
            txtHHCPath.Text = Properties.Settings.Default.HHCExePath;
            chkDeleteTempFile.Checked = Properties.Settings.Default.DeleteTempFile;
            txtHeaderHtml.Text = Properties.Settings.Default.DefaultHeaderHTML;
            txtFooterHtml.Text = Properties.Settings.Default.DefaultFooterHtml;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default["HHCExePath"] = txtHHCPath.Text;
            Properties.Settings.Default["DeleteTempFile"] = chkDeleteTempFile.Checked;
            Properties.Settings.Default["DefaultHeaderHTML"] = txtHeaderHtml.Text;
            Properties.Settings.Default["DefaultFooterHtml"] = txtFooterHtml.Text;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnBrowse_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Filter = "hhc.exe|hhc.exe";
                dlg.FileName = txtHHCPath.Text;
                dlg.CheckFileExists = true;
                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    txtHHCPath.Text = dlg.FileName;
                }
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

yuan yong fu
Web Developer duchang soft
China China
yuan yong fu of duchang soft , come from CHINA , 2008 Microsoft MVP,Use GDI+,XML/XSLT, site:http://www.cnblogs.com/xdesigner/

| Advertise | Privacy | Mobile
Web02 | 2.8.141015.1 | Last Updated 17 Nov 2010
Article Copyright 2010 by yuan yong fu
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid